Light intensities and matching Cycles

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.
chafouin
Posts: 120
Joined: Wed Jan 24, 2018 9:35 pm
Location: Los Angeles

Re: Light intensities and matching Cycles

Post by chafouin »

It's good on my side!

BYOB wanted to change the sun and sky intensities though, not sure what his plans are but it's probably better to do all of this in one release.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Light intensities and matching Cycles

Post by B.Y.O.B. »

chafouin wrote: Wed Feb 19, 2020 8:23 pm BYOB wanted to change the sun and sky intensities though, not sure what his plans are but it's probably better to do all of this in one release.
I already did this.
sun and sky now use a separate gain property with default 0.00002 to prevent overexposion with default tonemapper settings
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Light intensities and matching Cycles

Post by B.Y.O.B. »

I have started to write a script that converts old scenes to v2.3.
The code can be found here: https://github.com/LuxCoreRender/BlendL ... ibility.py
Still missing is tonemapper conversion (a very hard to solve problem) and light settings conversion.

@chafouin: Can you help me with the conversion code for regular lights?
I.e. convert from the old broken "gain + power + efficacy" to the new settings?

It is available under the new "LuxCore Tools" panel in the render properties:
Capture.PNG
chafouin
Posts: 120
Joined: Wed Jan 24, 2018 9:35 pm
Location: Los Angeles

Re: Light intensities and matching Cycles

Post by chafouin »

@B.Y.O.B. Area lights / Emissive materials are the only ones that should differ from 2.2, I have created a pull request with the conversion.
Sorry but I don't have the time to look into the two issues I mentionned in the pull request, I hope you can find a solution.

This will be a great release! Thanks for your hard work.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Light intensities and matching Cycles

Post by B.Y.O.B. »

Thanks, but I'm a bit puzzled.
In your code, you check for light.luxcore.light_unit == "power", but this will always evaluate to False, because the light_unit property did not exist in v2.2, so it will always be set to the default, which is "artistic".
So your conversion code is actually never executed.

I have created a testscene, this is how it looks in v2.2:
v2.2.png
This is how it looks in v2.3, with no conversion performed:
v2.3_no_conversion.png
Now with the conversion operator, as it was after your pull request (your code not being executed, and my code disabling blackbody normalization):
v2.3_converted_chafouin.png
And this is the result after I changed some code so your area light conversion is performed:
https://github.com/LuxCoreRender/BlendL ... 69211e4e16
v2.3_converted_byob.png
I have attached the scene.
From left to right, it's a meshlight, an area light, a spot light, a point light, and a meshlight with blackbody texture.
Attachments
v2.3_conversion_test_02.blend
(653.15 KiB) Downloaded 182 times
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Light intensities and matching Cycles

Post by B.Y.O.B. »

Got a bit further, now multiplying in the old gain:
https://github.com/LuxCoreRender/BlendL ... ity.py#L45

But there's still a slight difference in area light brightness.
Attachments
v2.3_converted_byob_new.png
chafouin
Posts: 120
Joined: Wed Jan 24, 2018 9:35 pm
Location: Los Angeles

Re: Light intensities and matching Cycles

Post by chafouin »

Sorry about that, I couldn't compare to 2.2 directly because I couldn't get it to run (couldn't import pyluxcore, whatever I tried, redistributable installed and all).

I only compared to Artistic / Gain as this shouldn't have changed in 2.3.

I'll have a look at your scene tonight. What if you remove that one pi multiplier? That's the only thing I am not sure if it was applied in 2.2 or not when everything was actually using Gain.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Light intensities and matching Cycles

Post by B.Y.O.B. »

chafouin wrote: Thu Feb 20, 2020 4:53 pm Sorry about that, I couldn't compare to 2.2 directly because I couldn't get it to run (couldn't import pyluxcore, whatever I tried, redistributable installed and all).
Huh, weird. If you need any more testscenes, I can create them for you.
chafouin wrote: Thu Feb 20, 2020 4:53 pm I'll have a look at your scene tonight. What if you remove that one pi multiplier? That's the only thing I am not sure if it was applied in 2.2 or not when everything was actually using Gain.
Good intuition, that did the trick.
Now the only thing left that's a bit different is the meshlight with blackbody, not sure what's going on there.
Attachments
without Pi multiplier
without Pi multiplier
chafouin
Posts: 120
Joined: Wed Jan 24, 2018 9:35 pm
Location: Los Angeles

Re: Light intensities and matching Cycles

Post by chafouin »

B.Y.O.B. wrote: Thu Feb 20, 2020 5:46 pm Good intuition, that did the trick.
Now the only thing left that's a bit different is the meshlight with blackbody, not sure what's going on there.
Normalize by Color Luminance should be checked on the Emission node in that case. Emission nodes using Power were working "as intended" and normalized in 2.2, if I'm not mistaken.
The viewport doesn't refresh correctly for the meshlight when running the operator also.
polyrhythm
Posts: 13
Joined: Wed Feb 26, 2020 1:35 am

Re: Light intensities and matching Cycles

Post by polyrhythm »

Got a simple question. I am following the developments in this thread but am not on 2.3 yet and wanted to try validating the irradiance output of a point light. Can someone check my math?

I have a simple scene like a pure white diffuse plane, and a single point light one meter above it.

I'm trying to recreate the following image:
Image

So, to go from watts to candelas, I _think_ I have to do...

Code: Select all

1/683 (watts per lumen) * 4pi (lumens per candela)
This gives me 0.0183987856725610 watts, or about 18mW. I plug that in to LuxCore and set the efficacy to 1 so that I know exactly how many lumens I'm dealing with.

In the resulting render, I get 0.00048 in the irradiance under the point light. To convert that irradiance (w/m^2) to illuminance (lm/m^2), I need to
- first bring it to w/cm^2, and 1 w/cm^2 = 104 w/m^2, so divide by 104
- get it to lux by multiplying by 6.83 * 10^6, so 683000

I end up with 3.1523...but it should be one lux, right? Am i doing something wrong?
Post Reply