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] Clustered lighting correctly supports light layers #4799

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Oct 31, 2022

Fixes #4791

  • instead of using all lights for clusters, only a set of lights used by the layer is used.

@mvaligursky mvaligursky self-assigned this Oct 31, 2022
@mvaligursky mvaligursky added bug area: graphics Graphics related issue labels Oct 31, 2022
@mvaligursky mvaligursky requested a review from a team October 31, 2022 12:58
Copy link
Contributor

@willeastcott willeastcott left a comment

Choose a reason for hiding this comment

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

Approving although slightly concerned about the forEach call. I tend to avoid those within the render loop because forEach is like an order of magnitude slower than a for loop (he says without the supporting data to hand).

@mvaligursky
Copy link
Contributor Author

Yeah I agree, but the data is stored in a Set and forEach is the only way to iterate it. I could maintain a dirty flag and update an array if Set changes, but I suspect this could be fine for just lights doing a single loop over those per frame.

@mvaligursky mvaligursky merged commit 12b27a7 into main Nov 1, 2022
@mvaligursky mvaligursky deleted the mv-cluster-layers branch November 1, 2022 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clustered lighting ignores layers on lights and meshes
2 participants