-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Spotlights do not work for orthographic projections #9605
Labels
Comments
github-merge-queue bot
pushed a commit
that referenced
this issue
Oct 8, 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).
regnarock
pushed a commit
to regnarock/bevy
that referenced
this issue
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 issue
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 issue
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
Bevy version
commit 4f1d9a6 (HEAD -> main, origin/main, origin/HEAD)
Date: Sun Aug 27 07:33:49 2023 -0700
[Optional] Relevant system information
cargo 1.70.0 (ec8a8a0ca 2023-04-25)
Debian 12
What you did
Tried to add spotlights (car headlights) to my game project, but they never show up. Finally I added a test spotlight which strangely appeared only toward the bottom of the screen (not across most of the rest of the screen). I think what matters is probably not the bottom of the screen, but the fact that the "ground" is naturally closer to the camera in that region of the screen.
Replicated this problem in the spotlight example (cargo run --example spotlight) by replacing the camera in
setup
with this camera:What went wrong
Expected: The spotlight should illuminate the scene in the same way it does with a perspective camera.
Actual: It does not illuminate the scene at all, or only some areas of the screen. Correct behavior is demonstrated in the example: https://bevyengine.org/examples/3D%20Rendering/spotlight/
Additional information
Other information that can be used to further reproduce or isolate the problem.
This commonly includes:
I wonder if this screenshot is informative. I captured this by taking video and then screen-shotting one frame of the video. It flashes like lightning.
The text was updated successfully, but these errors were encountered: