Page 1 of 1

wrong luminance calculation

Posted: Thu Nov 12, 2020 7:47 am
by lighting_freak
Hello all,

This is the test condition:
A light emitting surface with edge length of 1mm x 1mm emits 1 lm of light in an lambertian way.
This is observed by a camera very far away (infinte) normal to the light surface.

Theory says:
luminance = luminous flux / solid angle / projected lit up area
luminance = 1 lm / pi (solid angle of lambert emitter) / 0,000001 m^2
luminance = 318310 cd/m^2

Luxcore result is 172966 cd/m² read from Blender...
lumimage.jpg
I validated that with a professional software that reads *.exr files. It gives the same numbers as Blender.
A simulation with that software confirms the theoretical solution.

This is my test file:
Luminance_1.blend
(812.47 KiB) Downloaded 164 times
Please let me know your thoughts about that.
Thank you.

Re: wrong luminance calculation

Posted: Thu Nov 12, 2020 10:03 pm
by CodeHD
The difference seems to come from this line of code, where BlendLuxCore converts lumen to watt: https://github.com/LuxCoreRender/BlendL ... ht.py#L741

Let's calculate the factor: 2*pi*(1 - cos(90°/2)) = 1.84030,
as well as the ratio of your results: 318310/172966 = 1.84030 :arrow: the same.

I might be wrong becauseI always found this topic of luminous units confusing, but I came to this conclusion: I believe there was a mixup in the BelndLuxCore implementation, i.e. confusion between luminous flux (measured in lumen) and luminous intensity (measurd in candela).
Luminous flux is a measure of power weighted by the response of the human eye, which is a function of wavelength. Because LuxCore assumes the theoretical maximum of 683 lm/W, the two should just be equivalent. (And the equation used now actually exports Candela, not Watt).

P.S. 1: the equation should have used cos(spread_angle), not cos(spread_angle / 2), because spread_angle is already defined as the half angle.

P.S. 2: The same equation is used a few lines above in conversion from power to power: https://github.com/LuxCoreRender/BlendL ... ht.py#L731 :?:

P.S. 3: I'm wondering if, in LuxCore, "efficiency" should be divided by the same factor 683 https://github.com/LuxCoreRender/LuxCor ... l.cpp#L165

Re: wrong luminance calculation

Posted: Fri Nov 13, 2020 7:30 am
by lighting_freak
Hello,
CodeHD wrote: Thu Nov 12, 2020 10:03 pm Let's calculate the factor: 2*pi*(1 - cos(90°/2)) = 1.84030,
as well as the ratio of your results: 318310/172966 = 1.84030 :arrow: the same.
I don't really understand where this formula is coming from but it seems to cause that trouble. I totally agree.
A physics based conversion from Lumen to Watt should somehow use the v(lambda)-curve and should take into account the emitted color. The 683lm/W is only valid for monochromatic perfect green light...

I tested the cd option - it works fine.
I tested also the cd/m^2 option - works fine as well.

Can the above issue be fixed?

Re: wrong luminance calculation

Posted: Thu Nov 26, 2020 8:40 pm
by lighting_freak
Hi,

I'm quoting myself:
lighting_freak wrote: Fri Nov 13, 2020 7:30 am Can the above issue be fixed?
Please fix this bug that the created light output fits to real world data.
One more question to light sources:
If one use a 90° spread angle - the surface will emit light like a perfect lambertian emitter? It follows the Cosine-Law?
If the spread angle is reduced does luxcore cut the lambertain distribution is the cosine "shrinked" to the new angle?

With best regards