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 SpotLight and OmniLight cull masks not working in mobile renderer #86105

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

Conversation

jsjtxietian
Copy link
Contributor

Fixes #82263

I'm not sure whether there's any unexpected impacts that prevents us from adding it at the first place, feel free to correct me.

@jsjtxietian jsjtxietian requested a review from a team as a code owner December 13, 2023 04:43
@akien-mga akien-mga added bug topic:rendering cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Dec 13, 2023
@akien-mga akien-mga added this to the 4.3 milestone Dec 13, 2023
@BastiaanOlij
Copy link
Contributor

BastiaanOlij commented Dec 18, 2023

Hmm, this seems like a stopgap measure. In the mobile renderer the layer mask should already be applied during the culling stage as lights are paired with the objects they illuminate. A light should never end up being paired to an object if the layer mask doesn't match. Double checking it in the shader should yield no difference, only introduce more overhead.

If there are objects lit by lights that shouldn't light it, then there is an issue in the culling system.

@jsjtxietian
Copy link
Contributor Author

jsjtxietian commented Dec 18, 2023

In the mobile renderer the layer mask should already be applied during the culling stage as lights are paired with the objects they illuminate.

Interesting, so the real bug is lying in the cpu code, that does explains why it can cull the object in the first place, but after the object moves it stops working. I will take a look.

@jsjtxietian jsjtxietian marked this pull request as draft December 18, 2023 07:50
@AThousandShips AThousandShips modified the milestones: 4.3, 4.4 Jul 7, 2024
@AThousandShips AThousandShips added the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mobile/Compatibility: SpotLight and OmniLight cull masks don't cull moving meshes
4 participants