Reverts the default value of Environment.glow_hdr_threshold from 0.0
back to 1.0 to restore the expected glow appearance in existing projects.
The default was inadvertently changed from 1.0 to 0.0 in PR #110077,
which caused glow effects to render dramatically different across all
rendering methods (Forward+, Mobile, and GL Compatibility). This broke
backward compatibility with existing projects like the Kenney 3D
Platformer starter kit.
Changed files:
- scene/resources/environment.h
- servers/rendering/storage/environment_storage.h
- drivers/gles3/effects/glow.h
- drivers/gles3/rasterizer_scene_gles3.cpp
- doc/classes/Environment.xml
Setting the value back to 1.0 aligns with documented recommendations
and restores visual consistency.
Fixes#112469
Mobile devices are typically bandwidth bound which means we need to do as few texture samples as possible.
They typically use TBDR GPUs which means that all rendering takes place on special optimized tiles. As a side effect, reading back memory from tile to VRAM is really slow, especially on Mali devices.
This commit uses a technique where you do a small blur while downsampling, and then another small blur while upsampling to get really high quality glow. While this doesn't reduce the renderpass count very much, it does reduce the texture read bandwidth by almost 10 times. Overall glow was more texture-read bound than memory write, bound, so this was a huge win.
A side effect of this new technique is that we can gather the glow as we upsample instead of gathering the glow in the final tonemap pass. Doing so allows us to significantly reduce the cost of the tonemap pass as well.