-
-
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
[Merged by Bors] - Add orthographic camera support back to directional shadows #7796
Conversation
One moment, this does not work, I had accidentally worked from an old commit... |
Co-authored-by: François <[email protected]>
25c3636
to
bd50e4d
Compare
Actually, I'm 99% confident that the value I'm using for the I'm guessing that it's enough to build I'll dig into it more later or hopefully a rendering expert can chime in. Please feel free to open an alternative PR if that's easier. |
Maybe something along these lines, breaking the "frustum corners" math into a separate function: https://github.com/rparrett/bevy/tree/orthographic-directional-two |
I merged that other experimental branch into this one, edit: Actually, it seems like rotating a directional light with a low res shadow map is just sort of janky in bevy 0.9, orthographic, perspective, etc. But picking a random FOV is clearly wrong... This seems to be behaving |
ortho-shadows.movI think this is working properly. Note: Unlike with perspective projections, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this! Calculating the frustum corners differently for orthographic was exactly how I was going to approach this.
Co-authored-by: Daniel Chia <[email protected]>
Co-authored-by: Daniel Chia <[email protected]>
Co-authored-by: Daniel Chia <[email protected]>
Co-authored-by: Daniel Chia <[email protected]>
Co-authored-by: Daniel Chia <[email protected]>
Co-authored-by: Daniel Chia <[email protected]>
Co-authored-by: Daniel Chia <[email protected]>
If you don't mind, could you double check those corners again? After applying the last two suggestions they seemed obviously wrong/different for the far plane. |
Looks good to me! I wonder if github suggestions was doing some weird with them |
bors r+ |
# Objective Fixes #7797 ## Solution This **seems** like a simple fix, but I'm not 100% confident and I may have messed up the math in some way. In particular, I'm not sure what I should be using for an FOV value. However, this seems to be producing similar results to 0.9. Here's the `orthographic` example with a default directional light. edit: better screen grab below.
Pull request successfully merged into main. Build succeeded:
|
…ne#7796) # Objective Fixes bevyengine#7797 ## Solution This **seems** like a simple fix, but I'm not 100% confident and I may have messed up the math in some way. In particular, I'm not sure what I should be using for an FOV value. However, this seems to be producing similar results to 0.9. Here's the `orthographic` example with a default directional light. edit: better screen grab below.
Objective
Fixes #7797
Solution
This seems like a simple fix, but I'm not 100% confident and I may have messed up the math in some way. In particular, I'm not sure what I should be using for an FOV value.
However, this seems to be producing similar results to 0.9.
Here's the
orthographic
example with a default directional light.edit: better screen grab below.