-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 SSR orientation issues when using orthogonal camera #94184
Conversation
As discussed on RocketChat. Feel free to force-push to this PR with your additional fix to ensure that the reflections don't use perspective projection. I am happy either way! |
Regarding the second commit: SSR shader were using a view direction value calculated from the view space when raymarching, which produces perspective on the reflection with lower camera z-depths. Using a constant -z view direction solves this issue. Screenshots and an MRP can be found here: #79002 (comment) |
Looks great! The final step before merging is to squash all the commits together so that the whole PR only contains 1 big commit with all your changes. We like to merge one commit at a time to keep the git history clean and navigable. If you don't know how to do that, we have a helpful tutorial in the official documentation https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#the-interactive-rebase |
Oh, I see, that's why you mentioned force pushing 😅 On it. |
- Use negative clip space values to fix reversed rotations in reflections - Use constant -z view vector when raymarching to fix perspective in reflections
9a36de9
to
56ed2cb
Compare
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.
Looks great! Thank you for the quick fix
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.
Tested locally, it works as expected.
Before
ssr_ortho_before.mp4
After
ssr_ortho_after.mp4
Thanks! And congrats for your first merged Godot contribution 🎉 |
Negative view space reconstruction was causing reversed screen space reflection rotations when using the orthogonal camera. The fix should not affect perspective.