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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
@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
Copy link
Member Author

Rebased, should be good now!

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