-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Sky: Adapt radiance size if AUTOMATIC_MODE
resolves to REALTIME
#95990
Conversation
Breush
commented
Aug 23, 2024
•
edited by AThousandShips
Loading
edited by AThousandShips
- Bugsquad edit, fixes: Vulkan Forward+: Visual glitch appears in the radiance map at sizes higher or lower than the default #76166
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.
Tested locally, it works as expected. Code looks good to me.
AUTOMATIC_MODE
resolves to REALTIME
For the record, your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
Thanks, I didn't notice, updated my config. |
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.
I don't think this is the correct fix for two reasons:
material_get_data()
isn't thread safe. So this change introduces a race condition when using multithreaded rendering- This is hardcoded to only work with the Forward+ and Mobile rendering methods. It will fail when using Compatibility.
I think the correct fix is to not fall back to the realtime mode when the radiance size is not 256. I.e. check for radiance size here:
godot/servers/rendering/renderer_rd/environment/sky.cpp
Lines 1253 to 1256 in 61598c5
if (sky_mode == RS::SKY_MODE_AUTOMATIC) { | |
if (shader_data->uses_time || shader_data->uses_position) { | |
update_single_frame = true; | |
sky_mode = RS::SKY_MODE_REALTIME; |
and here:
godot/drivers/gles3/rasterizer_scene_gles3.cpp
Lines 914 to 917 in 61598c5
if (sky_mode == RS::SKY_MODE_AUTOMATIC) { | |
if (shader_data->uses_time || shader_data->uses_position) { | |
update_single_frame = true; | |
sky_mode = RS::SKY_MODE_REALTIME; |
e.g. if ((shader_data->uses_time || shader_data->uses_position) && sky->radiance_size == 256)
Got it. I will update this PR on Wednesday with the suggested fix. |
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.
Looks great!
Note for maintainers, this should be good for cherry picking
Thanks! And congrats for your first merged Godot contribution 🎉 |
Cherry-picked for 4.3.1. |