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

Update Light2D rect_cache even when not using shadows. #101110

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Jan 4, 2025

Fixes: #100922

Regression introduced in #100677

#100677 Updated the rect_cache to be in canvas space instead of light local space. However, it mistakenly only did that when shadows were enabled. So unshadowed lights had the rect_cache in the wrong coordinate space.

The simplest solution would be to just move the line that updates the rect_cache outside the scope of the use_shadow block. However, to avoid this sort of confusion, I have updated how the cache is calculated. Instead of setting it in one coordinate space then updating it, we initialize it in the proper coordinate space and only use the local rect in this code path.

This also cleans up how the rect_cache is updated to make the steps more clear
@clayjohn clayjohn added this to the 4.4 milestone Jan 4, 2025
@clayjohn clayjohn requested a review from a team as a code owner January 4, 2025 00:24
@akien-mga akien-mga changed the title Update Light2D rect_cache even when not using shadows. Update Light2D rect_cache even when not using shadows. Jan 6, 2025
@akien-mga akien-mga merged commit 0f76ee4 into godotengine:master Jan 6, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

Light2D culling is broken
3 participants