-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for GLES3 radiance cubemap update #97069
Fix for GLES3 radiance cubemap update #97069
Conversation
I think this is because it is updating over a few frames and the editor, by default only redraws when something changes. Can you double check by wiggling the mouse in the viewport to see if that makes it update right away? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting typo. Seems to indeed make sense, if I recall correctly we're processing +1 once all the layers are filled and we need to create the final result. So in GLES we just ended up not doing that final step.
This is an interesting remark, because we're spreading updating the radiance map over a few frames, and the editor will only render a frame when there is a reason to do so, this can indeed be delayed any given time. Not sure if setting it to update always is a good fix. I think a better fix here is to enhance the logic that skips rendering the frame in the editor when nothing has changed to also check if we're done updating radiance maps, or shadow maps, or any other things we spread out over multiple frames. I think that falls outside of this issue though. |
Thanks! |
Cherry-picked for 4.3.1. |
Thank you for reviews and merge. Indeed, wiggling the mouse in the editor causes the cubemap to update faster. |
Indeed, we have similar issues with TAA, volumetric fog or SDFGI. |
Info
With this fix, changing the WorldEnvironment's sky colours in Compatibility mode updates the radiance cubemap automatically, just as it happens in Vulcan. The same applies to the
Preview Environment
button in the editor.The logical condition is now the same as in the Vulcan version. Could I ask for a review by the authors of the original pieces of code? @clayjohn @BastiaanOlij
godot/drivers/gles3/rasterizer_scene_gles3.cpp
Lines 935 to 936 in 6681f25
godot/servers/rendering/renderer_rd/environment/sky.cpp
Lines 1273 to 1274 in 6681f25
Bug
Previously, making changes to the sky colours in Compatibility mode only produced an effect in the background of the scene. 3D objects were still illuminated by the previous environment, as the cubemap was not regenerated.
Lighting of objects was updated only after reloading the scene or creating a new
WorldEnvironment
or setting theprocess_mode
in Sky toSKY_MODE_REALTIME
.scene
after changing sky colors in preview
after saving changes into worldenvironment
Notes
I don't know to what extent this is normal behaviour, but for both GLES and Vulcan, in the default
process_mode
(SKY_MODE_AUTOMATIC), the radiance cubemap regenerates after a some delay (in Vulcan even after a few seconds). When SKY_MODE_REALTIME mode is enabled, the map regenerates immediately (maybe this mode should be selected by default when working in the editor?).