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 orthographic cluster aabb for spotlight culling #9614

Merged
merged 5 commits into from
Oct 8, 2023

Conversation

robtfm
Copy link
Contributor

@robtfm robtfm commented Aug 29, 2023

Objective

fix #9605

spotlight culling uses an incorrect cluster aabb for orthographic projections: it does not take into account the near and far cluster bounds at all.

Solution

use z_near and z_far to determine cluster aabb in orthographic mode.

i'm not 100% sure this is the only change that's needed, but i am sure this change is needed, and the example seems to work well now (CLUSTERED_FORWARD_DEBUG_CLUSTER_LIGHT_COMPLEXITY shows good bounds around the cone for a variety of orthographic setups).

@robtfm robtfm added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Aug 29, 2023
@robtfm
Copy link
Contributor Author

robtfm commented Sep 13, 2023

@itsybitesyspider any chance you could test if this works for you?

@itsybitesyspider
Copy link

Sure! I have to run to work now but I can test it in the next 24 hrs.

@itsybitesyspider
Copy link

Your branch (b70eb21) fixed the issue for me, both in the example and in my game project (modulo challenges to update my game project from 0.11).

It also did no harm to the use cases that already worked correctly.

I don't know what the norms are for approving PRs to bevy, but if it helps anyone, I would approve this PR.

@robtfm
Copy link
Contributor Author

robtfm commented Sep 14, 2023

I would approve this PR.

Yes please do, especially since you reported the bug, but it would be helpful regardless.

Thanks for checking!

@JMS55 JMS55 added this to the 0.12 milestone Sep 28, 2023
@JMS55 JMS55 requested a review from superdump October 1, 2023 21:33
@superdump superdump added this pull request to the merge queue Oct 8, 2023
Merged via the queue into bevyengine:main with commit d2dad4e Oct 8, 2023
20 checks passed
regnarock pushed a commit to regnarock/bevy that referenced this pull request Oct 13, 2023
# Objective

fix bevyengine#9605

spotlight culling uses an incorrect cluster aabb for orthographic
projections: it does not take into account the near and far cluster
bounds at all.

## Solution

use z_near and z_far to determine cluster aabb in orthographic mode.

i'm not 100% sure this is the only change that's needed, but i am sure
this change is needed, and the example seems to work well now
(CLUSTERED_FORWARD_DEBUG_CLUSTER_LIGHT_COMPLEXITY shows good bounds
around the cone for a variety of orthographic setups).
ameknite pushed a commit to ameknite/bevy that referenced this pull request Nov 6, 2023
# Objective

fix bevyengine#9605

spotlight culling uses an incorrect cluster aabb for orthographic
projections: it does not take into account the near and far cluster
bounds at all.

## Solution

use z_near and z_far to determine cluster aabb in orthographic mode.

i'm not 100% sure this is the only change that's needed, but i am sure
this change is needed, and the example seems to work well now
(CLUSTERED_FORWARD_DEBUG_CLUSTER_LIGHT_COMPLEXITY shows good bounds
around the cone for a variety of orthographic setups).
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

fix bevyengine#9605

spotlight culling uses an incorrect cluster aabb for orthographic
projections: it does not take into account the near and far cluster
bounds at all.

## Solution

use z_near and z_far to determine cluster aabb in orthographic mode.

i'm not 100% sure this is the only change that's needed, but i am sure
this change is needed, and the example seems to work well now
(CLUSTERED_FORWARD_DEBUG_CLUSTER_LIGHT_COMPLEXITY shows good bounds
around the cone for a variety of orthographic setups).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spotlights do not work for orthographic projections
4 participants