Implement support for physically based light intensity units
The engine is currently not using physically based units to specify light intensity, which would allow an easy way to realistically set up lights in the scene.
some references:
- filament (lighting section) https://google.github.io/filament/Filament.md.html
- frostbite, light units section https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
- unreal engine https://docs.unrealengine.com/4.26/en-US/BuildingWorlds/LightingAndShadows/PhysicalLightUnits/
- unity engine https://docs.unity3d.com/Packages/[email protected]/manual/Physical-Light-Units.html
This would be useful when implementing support for punctual lights https://github.com/playcanvas/engine/issues/2061 which specifies light intensities in physical units.
Note that Blender does not correctly export light intensities into gltf format, as it exports them in watts instead of expected lumens. https://github.com/KhronosGroup/glTF-Blender-IO/issues/564
Bump priority up on this.
Bump! It might not be physically based but does anyone know what the units currently are?
Is this something @GSterbrant might want to investigate?
It's actually a bit complicated, since it's different for different types of lights. Filament describes it very well here: https://google.github.io/filament/Filament.md.html#lighting/units
Of course this puts even more emphasis on the importance of it. Using 1 for the sun intensity doesn't really translate to using 1 as intensity for a spotlight.
This might help https://docs.google.com/spreadsheets/d/1Ce9XCC2Ub9eVjAQdYbYdLvlkDBJ_0GtAyRbSF0KJWzE/edit#gid=0
Basically, different lights use different units. GLTF spec is the one that probably makes sense. I think threejs had a nasty flag like usePhysicalLights to enable the change
We'd probably a flag like that too, to not break old projects...
closing as its fixed in https://github.com/playcanvas/engine/pull/4618