Skip to content

Conversation

Mysak0CZ
Copy link
Contributor

@Mysak0CZ Mysak0CZ commented Mar 26, 2025

fixes #11301

Description of change

The current implementation of inverse masks works by incrementing stencil buffer where mask is, and then draws only on pixels that don't match the mask depth.
The passOp, however, was set to replace, which caused the stencil buffer to be set to the mask value in all areas where something was drawn.
This effectively caused the effect that only first drawn thing was visible per-pixel.

This simple fix changes the passOp to be "keep" - same as non-inverse variant, and updates the relevant test to test for this usecase.

Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

Copy link

codesandbox-ci bot commented Mar 26, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d805436:

Sandbox Source
pixi.js-sandbox Configuration

@Mysak0CZ Mysak0CZ force-pushed the fix/stencil-inverse-mask-multiple branch from 4698425 to ce0a370 Compare March 26, 2025 19:03
@Zyie Zyie requested a review from GoodBoyDigital April 29, 2025 11:32
@Mysak0CZ
Copy link
Contributor Author

Mysak0CZ commented May 7, 2025

Hello @GoodBoyDigital! Could I please ask you to review this tiny fix? Thank you in advance!

Copy link
Member

@GoodBoyDigital GoodBoyDigital left a comment

Choose a reason for hiding this comment

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

great catch! Perfect PR :)

@GoodBoyDigital GoodBoyDigital added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label May 9, 2025
@Zyie Zyie added this pull request to the merge queue May 9, 2025
Merged via the queue into pixijs:dev with commit ebb1a97 May 9, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Inverse mask ignores the render order and draws on top
3 participants