Visual Changes to PointLight & SpotLight in 3.10
PR #2549 (currently un-merged) will fix a long-standing issue with the engine’s PointLight and SpotLight when used with PBR. These changes will result in changes to the attenuation and visual radius of existing lights, ultimately improving them and putting them closer to industry standards for PBR.
The current algorithm used by our engine’s PBR implementation (that has been used since the shader’s creation) is incorrect for PBR, which makes the radius harder to configure properly and also causes visual bugs in some cases, especially with many overlapping lights. So this PR updates the engine’s PBRLightingUtils.glsllib shader lib to instead use the standard inverse square algorithm (which is also used for PBR in Blender, Unreal, Godot etc).
So while this is considered a visual bug fix and improvement, it is also technically (by release standard) a breaking change. These changes will cause existing point and spot lights in PBR scenes to spread light more accurately to their radius, meaning that your current lights in PBR scenes will need the radius reduced to have the same visual radius that you had prior to these changes. This also elminates bugs that can occurr due to our old implementation and ultimately looks better in scenes with many lights, so it is considered an acceptable breakage in pursuit of improving the engine’s graphical capabilities.
To better illustrate this change, here are screenshots from the PR showing the same scene in bledner, in jME before this PR, and in jME after this PR. After this PR it matches blender (and the industry standard) much more accurately, but you also will notice the light does not spread as far.
Blender:
JME Without this PR:
JME With this PR:
Our Point and Spot light will still be missing some extra params that could further improve their capabilities, but fixing our algorithm to use the correct inverse square algorithm is the first step to set the foundation needed in order to add more params to further improve Point and Spot lights in accordance with industry standards.
If anyone is against these changes, we may consider adding a toggleable boolean so you can revert back to using the old point and spot light code so that you don’t have to reconfigure your radius values for old lights if you really don’t want to (but objectively speaking the new changes will be better and I would highly suggest everyone adapt to them rather than attempt to hold onto the old algorithm). These changes can be expected in the next alpha2 release of 3.10 so you will be able to see and test the changes for yourself soon. Any feedback or thoughts on these changes are welcome.
Discussion in the ATmosphere