Page 6 of 9

Re: Light intensities and matching Cycles

Posted: Thu Feb 27, 2020 5:03 pm
by chafouin
Dade wrote: Thu Feb 27, 2020 10:06 am It has a radius (0.100000001), it is not a point light source :!:
Point light radius doesn't affect its brightness.

I am really confused by all this. I simplified the math for point lights candelas and noticed a very small difference in brightness, this is fixed now (needs to be merged).
But it doesn't explain that difference in irradiance, as if Power didn't output the expected brightness.

Re: Light intensities and matching Cycles

Posted: Thu Feb 27, 2020 7:13 pm
by Dade
chafouin wrote: Thu Feb 27, 2020 5:03 pm
Dade wrote: Thu Feb 27, 2020 10:06 am It has a radius (0.100000001), it is not a point light source :!:
Point light radius doesn't affect its brightness.
It is a sphere light source, not a point light source:

Code: Select all

scene.lights.140132073280008.type = "sphere"
It does a LOT of difference: https://github.com/LuxCoreRender/LuxCor ... t.cpp#L150

The emitted factor is divided by the sphere surface.

Re: Light intensities and matching Cycles

Posted: Thu Feb 27, 2020 8:49 pm
by chafouin
AFAIK BlendLuxCore doesn't allow to create a real point light.
This is a naming issue, what we call point light nowadays in PBR engines are all sphere lights with a minimum radius.

Thanks for showing the code. I need to wrap my head around this...

Re: Light intensities and matching Cycles

Posted: Thu Feb 27, 2020 9:55 pm
by B.Y.O.B.
chafouin wrote: Thu Feb 27, 2020 8:49 pm AFAIK BlendLuxCore doesn't allow to create a real point light.
It does, just set the radius to 0: https://github.com/LuxCoreRender/BlendL ... ght.py#L83

Re: Light intensities and matching Cycles

Posted: Fri Feb 28, 2020 1:18 am
by polyrhythm
chafouin wrote: Thu Feb 27, 2020 8:49 pm AFAIK BlendLuxCore doesn't allow to create a real point light.
This is a naming issue, what we call point light nowadays in PBR engines are all sphere lights with a minimum radius.

Thanks for showing the code. I need to wrap my head around this...
I find a lot of engines have attenuation that is treated as a point light, but a "size" (radius) is used to control specular highlight size and shadow blurriness. The current UE4 implementation of attenuation can be found here:

https://cdn2.unrealengine.com/Resources ... 915738.pdf

and Filament's documentation provides some very clear descriptions of how they handle point lights:

https://google.github.io/filament/Filam ... tuallights

My company's old engine code used this 2011-era attenuation logic which _does_ mimic sphere light attenuation but we tossed it since it was very unusable: https://imdoingitwrong.wordpress.com/20 ... tenuation/

Note that I'm not saying LuxCore should do any of that given that it's not a rasterizer, just food for thought and also how I personally am used to working. We found that lighting artists consistently mis-used point lights where they could set the physical radius because it changed the intensity of the light (as alluded to above). It was difficult to adjust lights for, say, specular highlight size or shadow blurriness, since all settings also changed overall intensity, making it a multivariable problem. When we switched to light radius only affecting shadows and specular highlights, things became much easier to adjust.

Re: Light intensities and matching Cycles

Posted: Fri Feb 28, 2020 4:23 am
by polyrhythm
Also I changed my light to a true point light (radius 0) and it didn't meaningfully impact the resulting irradiance result. From the other thread linked, I can see that the current irradiance implementation has not officially been verified or tested against any known good results, so I'll treat it as magic numbers for now? I'll try to look through some of the code and piece together mentally what is happening based on what you and chafouin are saying.

The Irradiance AOV Contour Lines can have their scale set in Blender, but there are no settings specific to the irradiance AOV itself. The numbers chafouin brings up (179 / 683) is tantalizingly close and yet I am now afraid of latching onto red herrings unless I'm sure :).

Re: Light intensities and matching Cycles

Posted: Fri Feb 28, 2020 4:40 am
by chafouin
Dade wrote: Thu Feb 27, 2020 7:13 pm It does a LOT of difference: https://github.com/LuxCoreRender/LuxCor ... t.cpp#L150
As polyrhythm pointed out, it doesn't, actually. That's why I thought it wasn't even possible to make a point light, because I couldn't see a difference in how brightness is calculated (except that I assume you avoid the division by sphere surface when it's equal to 0).
polyrhythm wrote: Fri Feb 28, 2020 1:18 am I find a lot of engines have attenuation that is treated as a point light, but a "size" (radius) is used to control specular highlight size and shadow blurriness.
The size of the light source works the same in LuxCore (CORRECTION: Not in Cycles). It doesn't affect light intensity exactly because the emitted gain is divided by the sphere surface.

Attenuation radius is mostly there in real-time engines to optimize light overlapping, and since it can affect the inverse square light falloff (i.e. if the radius is shorter than the visible light contribution), it's usually not something you need in offline renders (although I'm a strong defender of giving more control to the artists when possible).

Re: Light intensities and matching Cycles

Posted: Fri Feb 28, 2020 4:41 am
by polyrhythm
One more funny thing. I know, I must be getting tiring.

As mentioned, the one candela point light results in around 0.256 "irradiance".

If I switch it to 4Pi Lumens (one cd = 4pi l), I now get a slightly brighter result at 0.318. Close to pi, but maybe not a thing, given how close these all kinda are to pi. One would assume that 4pi lumens is the exact same as one candela, though.

Re: Light intensities and matching Cycles

Posted: Fri Feb 28, 2020 5:07 am
by chafouin
polyrhythm wrote: Fri Feb 28, 2020 4:41 am If I switch it to 4Pi Lumens (one cd = 4pi l), I now get a slightly brighter result at 0.318. Close to pi, but maybe not a thing, given how close these all kinda are to pi. One would assume that 4pi lumens is the exact same as one candela, though.
This was the inaccuracy I fixed this morning. Either download the latest blendluxcore from GitHub or wait for tomorrow's build.

Re: Light intensities and matching Cycles

Posted: Sat Feb 29, 2020 8:45 am
by chafouin
For what it's worth, I compared to Mitsuba and it seems that their point light is brighter by a 4*PI factor (I just compared two renders visually). Which doesn't help as this is way more than the brightness difference we see here when measuring the irradiance, but since Mitsuba is often regarded as the scientific ground truth renderer, I wanted to check.
https://github.com/mitsuba-renderer/mit ... /point.cpp

LuxCore is identical to Cycles that gives the same brightness at equal power with efficacy at 1 lm/W.