Gltf-blender-io: Intensity units when exporting point lights

Created on 24 Jun 2019  路  5Comments  路  Source: KhronosGroup/glTF-Blender-IO

Blender uses watts as units for power of point light sources.
On the other hand, KHR_punctual_lights use lm/sr as light intensity units.

I can see that values from point light power settings are directly written to gltf file without watts -> lumen -> candela conversion.

Mesh_&_Object bug exporter

Most helpful comment

Not for nothing, but it took me about three hours of searching to find this thread so that I could find out how to convert watts to lumens because I'm primarily a designer with a limited math background. I'm currently trying to import a gltf into three.js that was exported from blender by another designer.

On one hand, thank you so much for posting those formulas. On the other, is there any idea when the fix for this might be implemented?

Thank you!

All 5 comments

/cc https://github.com/KhronosGroup/glTF-Blender-IO/issues/24 and https://github.com/KhronosGroup/glTF-Blender-IO/issues/528.

Previously we weren't sure what Blender's units were, but the UI does pretty clearly show watts now anyway...
Screen Shot 2019-06-24 at 9 50 49 AM

As far as I understand Power field in light settings denotes wattage emitted by light source, not consumed, otherwise everything may be even more difficult.

I've done some back-of-the-envolope computation, so here it goes:

- Kv (683) - maximum spectral luminous efficacy of radiation for photoscopic vision,
  for 555 nm wavelength, that is most perceptually efficient for human vision
- 桅e - radiant flux [watts]
- 桅v - luminous flux [lumens]
- Iv - luminous intensity [lm/sr or candela], what KHR_punctual_lights mandates for point lights
--
桅v = Kv * 桅e
Iv = 桅v / 4PI
=>
Lv = Kv * 桅e / 4PI // for point light source

Computations are a bit subtler for spot lights:
https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf

I am not totally sure we should have this very watt -> lumen conversion, but at least it gets the physical units correct, the rest I guess should be handled by gltf model consumer.

Any chance to get this tagged as a bug? The units for the light intensity seems to be wrong.

According to the glTF specs:
1) point and spot lights use luminous intensity in candela (lm/sr), this exporter uses Watts
2) directional lights use illuminance in lux (lm/m2), this exporter uses "Strength"

the exported units should be as specified in the glTF specs.

Tagged as bug

Not for nothing, but it took me about three hours of searching to find this thread so that I could find out how to convert watts to lumens because I'm primarily a designer with a limited math background. I'm currently trying to import a gltf into three.js that was exported from blender by another designer.

On one hand, thank you so much for posting those formulas. On the other, is there any idea when the fix for this might be implemented?

Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spiraloid picture spiraloid  路  5Comments

Quinten123 picture Quinten123  路  4Comments

UX3D-nopper picture UX3D-nopper  路  3Comments

donmccurdy picture donmccurdy  路  5Comments

Ali-RS picture Ali-RS  路  3Comments