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

Fix sharing World2D between SubViewports causes 2D lights of one SubViewport to go missing #90282

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

jhlothamer
Copy link
Contributor

@jhlothamer jhlothamer commented Apr 5, 2024

This PR fixes an issue where Light2D is seemingly lost or invisible when its parent SubViewport's world_2d is set to another SubViewport's. Originally Light2D only reattached itself to a canvas on the NOTIFICATION_ENTER_TREE notification. Since in the world-sharing use case the Light2D is not entering the node tree, it remained associated with the canvas of the orignal world. The update uses the NOTIFICATION_ENTER_CANVAS and NOTIFICATION_EXIT_CANVAS notifications instead. This brings Light2D in line with LightOccluder2D which works fine.

Edited:

Fixes: #84221

@jhlothamer jhlothamer requested a review from a team as a code owner April 5, 2024 21:55
@fire fire changed the title fix issue 84221 - Sharing World2D Between SubViewport's Causes 2D Lights of One SubViewport to Go Missing Sharing World2D Between SubViewport's Causes 2D Lights of One SubViewport to Go Missing Apr 6, 2024
@AThousandShips AThousandShips added this to the 4.3 milestone Apr 6, 2024
@akien-mga akien-mga changed the title Sharing World2D Between SubViewport's Causes 2D Lights of One SubViewport to Go Missing Fix sharing World2D between SubViewports causes 2D lights of one SubViewport to go missing Apr 8, 2024
@akien-mga akien-mga merged commit e68f03a into godotengine:master Apr 8, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

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.

Sharing World2D Between SubViewport's Causes 2D Lights of One SubViewport to Go Missing
4 participants