-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Vulkan: Screen space reflections weirdly rotated with orthogonal cameras #79002
Comments
Also suffering this issue in my project. Reproducible in every v4.x.x release. Using negative camera space positions solves the wrong reflection rotations in orthogonal cameras. Turns out the rotations were actually reversed in here: godot/servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_inc.glsl Lines 22 to 26 in 26d1577
So, line 23 becomes: return vec3(-(screen_pos.xy * params.proj_info.xy + params.proj_info.zw), z); However, issue #49204 from branch 3.x appeared here, too. Reflections gain perspective in orthographic cameras as the z-position of the camera lowers. Here is a minimal reproduction of this in a custom build with the fix above: Whereas the expected behavior is much more like this: @Geometror's workaround mentioned in the other issue can also be applied here once this issue is fixed. But still, reflections in an orthogonal camera should be… orthographic, I guess 😅 Perspective can be omitted entirely for SSR with orthogonal cameras. |
Good catch 🙂
Can you open a pull request for this? |
Godot version
v4.0.3.stable.official [5222a99]
System information
Mac Ventura - Vulkan API 1.2.231 - Forward+ - Apple M1
Issue description
SSR doesn't appear correctly with orthographic cameras, the reflections are rotated around seemingly inverse to the camera.
There's a similar issue #49204, however the previous one is for Godot 3.5 and the workarounds no longer work. The editor camera no longer works properly, and neither does moving the camera far away. I believe this may be a different (though likely related) problem. Hopefully this is okay.
Screenshot:
Best regards.
Steps to reproduce
OrthoCamera
-- this is set to use the previous workaround of moving the camera far away, however this doesn't seem to work anymoreMinimal reproduction project
SSRTest.zip
The text was updated successfully, but these errors were encountered: