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

Mask out shadows on CanvasItems that don't have a matching item_shadow_mask #98835

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Nov 5, 2024

Fixes: #64939

Fixing this required a small amount of refactoring to move some of the per-instance flags into a new per-batch flag. This was needed to free up the required 16 bits for the shadow mask. We do the actual masking on the CPU and then just store a binary value for whether that lights shadow impacts that CanvasItem. This saves instructions in the shader.

@clayjohn clayjohn added this to the 4.4 milestone Nov 5, 2024
@clayjohn clayjohn requested a review from a team as a code owner November 5, 2024 05:24
@clayjohn clayjohn force-pushed the Light2D-shadow-mask branch from 57290da to d7c1ac4 Compare November 5, 2024 20:08
@akien-mga akien-mga changed the title Mask out shadows on CanvasItems that don't have a matching item_shadow_mask Mask out shadows on CanvasItems that don't have a matching item_shadow_mask Nov 13, 2024
@huwpascoe
Copy link
Contributor

2D shadow masking is working!

image

notify #93881

Copy link
Contributor

@huwpascoe huwpascoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works as intended.

@Repiteo
Copy link
Contributor

Repiteo commented Nov 19, 2024

Gonna need to be rebased before this can be merged

@clayjohn clayjohn force-pushed the Light2D-shadow-mask branch from d7c1ac4 to 2b68c63 Compare November 22, 2024 06:16
@clayjohn
Copy link
Member Author

Rebased, should be good now!

@Repiteo Repiteo merged commit c1b4e06 into godotengine:master Nov 22, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 22, 2024

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.

CanvasItem light_mask is ignored by LightOccluder2D occluder_light_mask
3 participants