Ensure RenderLayers is a Component on every ExtractedLight and its ShadowView/ExtractedView#24797
Open
kfc35 wants to merge 1 commit into
Open
Ensure RenderLayers is a Component on every ExtractedLight and its ShadowView/ExtractedView#24797kfc35 wants to merge 1 commit into
kfc35 wants to merge 1 commit into
Conversation
Zeophlite
approved these changes
Jun 29, 2026
Zeophlite
left a comment
Contributor
There was a problem hiding this comment.
I think this is a better separation of concerns
alice-i-cecile
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fixes #24792
queue_shadows()currently queues shadows erroneously because the view light entity never has theRenderLayerscomponent correctly attached. This not only affects directional lights as described in the issue, but all the light types.Solution
queue_shadows()actually works with render layers by ensuring that the light entity always has render layers specified. (rect light is an exception since it doesn’t have shadows currently)RenderLayersis attached to extracted lights — I figured that, since it’s a component, it should be attached separately (i.e. not set directly to the extracted structure a laExtractedDirectionalLight. I remove theRenderLayersfrom that component.).Note that this issue/fix is separate from the problem described in #23264. This only ensures the light <-> mesh render layer relationship is respected when queueing shadows. This doesn’t fix anything about the light illuminating the wrong meshes and does not touch any shader code.
Testing
pcssexample and changed between the lights andrect_lightjust to make sure there isn't a regression.