Lux measurement using Irradiance feature

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
pro
Posts: 23
Joined: Wed Dec 12, 2018 7:48 am

Lux measurement using Irradiance feature

Post by pro »

Hi,

I'm a new user of LuxCore and first of all I would like to thank you for open source LuxCoreRender - it's really a powerful tool. I am also new to the physics of light so please bear with me and correct me if i misinterpreted anything.

My goal is to obtain a numerical representation of illuminance on a given surface, measured in "lux" unit.
I found there is a "Irradiance feature" available in LuxCore (it has also a python API in Blender available) and I have questions related to it.

1. I found a radiological definition of "Irradiance" which is quantified in watts/m². Does your implementation also measure it in this unit? Which C++ files should I look to find more details about the implementation of Irradiance feature?
2. Since I want the result in "lux" unit (which is defined in photometry as Illuminance (lumen/m^2)) , I would like to ask you if it´s possible to obtain lux values in some way from Irradiance feature?
3. I was googling about the conversion from irradiance (radiological quantity) to illuminance (photometric quantity), but reading this https://www.researchgate.net/post/How_t ... m_2_to_lux i am not sure if a direct conversion exists?
4. Why is the constant 179 used as the default scale value in Irradiance feature? Does it have to to anything with the conversion from question 3?
5. In Blender there is only a possibility to draw contour representation using this feature. Since my goal is to get lux value for each "pixel" on the surface, I need a way to export values. I was looking at the examples: viewtopic.php?t=374 and I found that .exr format is used to export the values. First of all I would like to ask you what do the exported values in .exr format mean (coordinate by coordinate)?
6. Is there a way of getting .exr file using Irradiance feature in Blender (previous example is an example using C++ engine directly).

Thank you for your time answering my questions! :)
Last edited by pro on Sat Dec 22, 2018 2:51 pm, edited 1 time in total.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Lux measurement using Irradiance feature (Blender)

Post by B.Y.O.B. »

pro wrote: Fri Dec 21, 2018 12:49 pm 6. Is there a way of getting .exr file using Irradiance feature in Blender (previous example is an example using C++ engine directly).
Yes, you can enable the Irradiance AOV in the render layer settings.
Then you get the irradiance data as an additional render pass in Blender, which you can save as .exr or any other format you like.
Attachments
2018-12-21_15-04-14.png
irradiance_example.blend
(141.26 KiB) Downloaded 317 times
pro
Posts: 23
Joined: Wed Dec 12, 2018 7:48 am

Re: Lux measurement using Irradiance feature (Blender)

Post by pro »

B.Y.O.B. wrote: Fri Dec 21, 2018 2:07 pm Yes, you can enable the Irradiance AOV in the render layer settings.
Then you get the irradiance data as an additional render pass in Blender, which you can save as .exr or any other format you like.
Thank you for your quick answer! I managed to get Irradiance AOV values out now thanks to your suggestion.
Based on the image published in this tweet: https://twitter.com/Dade916/status/546253221023723520
I suppose that the returned values on this AOV are given in lux unit, but since I'm not 100% sure if that's the case (the program is also named lux) I would like to ask you to confirm/reject that?

Thank you very much in advance!
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Lux measurement using Irradiance feature

Post by B.Y.O.B. »

This is a question for Dade.
I could only find out that irradiance is generally given in watt per square metre, while 1 lux is 1 lumen per square metre. Not sure what LuxCore uses.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Lux measurement using Irradiance feature

Post by Dade »

I have written this code a while ago and I don't sincerely remember very much. Anyway the general idea was to mimic Radiance (https://www.radiance-online.org) behavior.

You can find a discussion about the topic of this thread and Radiance behavior here: https://www.radiance-online.org//piperm ... 03615.html (Greg's answer: https://www.radiance-online.org//piperm ... 03616.html)

The Contour Line plugin translate the values (if using the "179" scale) in Lux to be "compatible" with Radiance "falsecolor" command line utility but the original AOV values should be in lm/w. If you use a plugin "1" scale, it should work just in plain lm/w.

Measuring the values over an arbitrary set of points (for instance, a table surface) would require a new type of "camera" (something getting as input a text file with a generic list of rays to trace). It is not something particularly hard to add (at least for the CPU code) but it isn't exactly an high priority topic in my TODO list.

In general this code has not been tested or validated so any use would first require some checking/validation of the results: render some simple scene where you can compute the result with paper and pen and check the output (for instance a point light 1 meter away from a surface, etc.).
Support LuxCoreRender project with salts and bounties
pro
Posts: 23
Joined: Wed Dec 12, 2018 7:48 am

Re: Lux measurement using Irradiance feature

Post by pro »

Dade wrote: Thu Jan 03, 2019 10:09 am
Measuring the values over an arbitrary set of points (for instance, a table surface) would require a new type of "camera" (something getting as input a text file with a generic list of rays to trace). It is not something particularly hard to add (at least for the CPU code) but it isn't exactly an high priority topic in my TODO list.
Thank you very much for the provided answers and for the description of the situation! Is it possible for me to somehow collaborate on this topic - maybe with your help and suggestions which files to edit/add I would be able to do the majority of work? I guess programming techniques etc. should not be such a problem for me if I would know fairly defined steps.. The final goal is probably to have a GPU implementation but a CPU version would also be sufficient for testing/validation purpuses. What is your opinion on that and the related work load?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Lux measurement using Irradiance feature

Post by Dade »

pro wrote: Tue Jan 08, 2019 6:49 am [Thank you very much for the provided answers and for the description of the situation! Is it possible for me to somehow collaborate on this topic - maybe with your help and suggestions which files to edit/add I would be able to do the majority of work? I guess programming techniques etc. should not be such a problem for me if I would know fairly defined steps.. The final goal is probably to have a GPU implementation but a CPU version would also be sufficient for testing/validation purpuses. What is your opinion on that and the related work load?
Yes, it is possible (but it may be too easy), at the end of the day, 99% of the work is just the implementation of a C++ class derived from the Camera class: https://github.com/LuxCoreRender/LuxCor ... s/camera.h (like the other type of cameras).

Anyway, the very first step is being able to compile LuxCore on your own, are you able ?
Support LuxCoreRender project with salts and bounties
pro
Posts: 23
Joined: Wed Dec 12, 2018 7:48 am

Re: Lux measurement using Irradiance feature

Post by pro »

Dade wrote: Wed Jan 09, 2019 10:41 am Anyway, the very first step is being able to compile LuxCore on your own, are you able ?
Ok, thank you! Yes, I compiled it in Windows before. So I would probably need to edit LuxRays.sln project using VisualStudio, which is located in luxcorerender\WindowsCompile\Build_CMake\LuxCore ?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Lux measurement using Irradiance feature

Post by Dade »

pro wrote: Wed Jan 09, 2019 12:07 pm
Dade wrote: Wed Jan 09, 2019 10:41 am Anyway, the very first step is being able to compile LuxCore on your own, are you able ?
Ok, thank you! Yes, I compiled it in Windows before. So I would probably need to edit LuxRays.sln project using VisualStudio, which is located in luxcorerender\WindowsCompile\Build_CMake\LuxCore ?
You should add a new file to compile to CMake configuration file here: https://github.com/LuxCoreRender/LuxCor ... s.txt#L260

The VisualStudio project is then generated by CMake.
Support LuxCoreRender project with salts and bounties
pro
Posts: 23
Joined: Wed Dec 12, 2018 7:48 am

Re: Lux measurement using Irradiance feature

Post by pro »

Dade wrote: Wed Jan 09, 2019 1:21 pm You should add a new file to compile to CMake configuration file here: https://github.com/LuxCoreRender/LuxCor ... s.txt#L260
Ok, I duplicated camera.cpp, and renamed it to my_camera.cpp, and added the line with my_camera.cpp in CMakeLists.txt.
Post Reply