Skip to content
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

Properly initialize directional_light_count in RD sky shaders #71526

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

clayjohn
Copy link
Member

Fixes: #70015

The directional light count in the shader was left uninitialized if there were no directional lights used in the shader. This is a huge problem as sun_scatter loops over all directional lights.

In the run that I managed to capture this meant the shader thought that there were over 524,000 DirectionalLights in the scene and it was running the sun scatter code for each of them, naturally reading from random memory for each.

@clayjohn clayjohn added this to the 4.0 milestone Jan 16, 2023
@clayjohn clayjohn requested a review from BastiaanOlij January 16, 2023 21:11
@clayjohn clayjohn requested a review from a team as a code owner January 16, 2023 21:11
@akien-mga akien-mga merged commit 0ddd9c3 into godotengine:master Jan 16, 2023
@akien-mga
Copy link
Member

Thanks!

@clayjohn clayjohn deleted the RD-sun-scatter branch July 24, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vulkan: Environment Fog: Severe sky shader-related instability when PanoramaSky is used
2 participants