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 mask just valid in render queue and culled by camera's cullingMask #2341

Closed
singlecoder opened this issue Aug 20, 2024 · 0 comments · Fixed by #2369
Closed

Fix mask just valid in render queue and culled by camera's cullingMask #2341

singlecoder opened this issue Aug 20, 2024 · 0 comments · Fixed by #2369
Assignees
Labels

Comments

@singlecoder
Copy link
Member

singlecoder commented Aug 20, 2024

问题描述

当前 Mask 有 2 个比较影响使用的问题:

  • SpriteMask 应该是场景级别有效
  • SpriteMask 不应该被相机的 cullingMask 裁剪掉

解决思路

  • MaskManager 的 preMaskLayer 和 Stencil 强关联,需要和场景每个相机的渲染更新保持一致,也就是每次相机渲染 clear stencil 的时候,preMaskLayer = 0
  • 和相机 cullingMask 的裁剪判断抽象出 API,由 Renderer 自行实现
@singlecoder singlecoder added the 2D label Aug 20, 2024
@singlecoder singlecoder self-assigned this Aug 20, 2024
@singlecoder singlecoder linked a pull request Sep 3, 2024 that will close this issue
@singlecoder singlecoder changed the title Refactor Mask Layer in MaskManager Fix mask just valid in render queue Sep 10, 2024
@singlecoder singlecoder changed the title Fix mask just valid in render queue Fix mask just valid in render queue and culled by camera's cullingMask Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant