diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2020-11-26 11:48:42 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2020-11-26 16:42:10 +0100 |
commit | 9c682cf8ffe302719df1202d89e560e4fe67739d (patch) | |
tree | 744a1d8aeea9e14cf442e359a1110d6860b8ecfe /tests/manual | |
parent | 1e2902ba3e1285fb2db5a90712135b130fdbbb84 (diff) |
Use RHI's clipSpaceCorrMatrix for backend where Y is not up
It's better to rely on RHI instead of a hard coded matrix.
Also modify the UBO to provide the clipSpaceCorrectionMatrix and the
uncorrected projectionMatrix.
All the other matrices we compute and provide use the corrected projectionMatrix
but these two new matrices give users the libertity of bypassing the
correction if they need to.
Pick-to: 6.0 6.0.0
Change-Id: I52e409cc9b38ea0e939d19d92e2ddd907aa7d1cb
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/rhi/simple-rhi-cpp/main.cpp | 4 | ||||
-rw-r--r-- | tests/manual/rhi/ubo/main.qml | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/manual/rhi/simple-rhi-cpp/main.cpp b/tests/manual/rhi/simple-rhi-cpp/main.cpp index 123647ac1..f839012f2 100644 --- a/tests/manual/rhi/simple-rhi-cpp/main.cpp +++ b/tests/manual/rhi/simple-rhi-cpp/main.cpp @@ -109,6 +109,8 @@ layout(location = 0) out vec3 color; layout(std140, binding = 0) uniform qt3d_render_view_uniforms { mat4 viewMatrix; mat4 projectionMatrix; + mat4 uncorrectedProjectionMatrix; + mat4 clipCorrectionMatrix; mat4 viewProjectionMatrix; mat4 inverseViewMatrix; mat4 inverseProjectionMatrix; @@ -150,6 +152,8 @@ layout(location = 0) in vec3 color; layout(std140, binding = 0) uniform qt3d_render_view_uniforms { mat4 viewMatrix; mat4 projectionMatrix; + mat4 uncorrectedProjectionMatrix; + mat4 clipCorrectionMatrix; mat4 viewProjectionMatrix; mat4 inverseViewMatrix; mat4 inverseProjectionMatrix; diff --git a/tests/manual/rhi/ubo/main.qml b/tests/manual/rhi/ubo/main.qml index b658a55b7..33f2adb99 100644 --- a/tests/manual/rhi/ubo/main.qml +++ b/tests/manual/rhi/ubo/main.qml @@ -109,6 +109,8 @@ Entity { layout(std140, binding = 0) uniform qt3d_render_view_uniforms { mat4 viewMatrix; mat4 projectionMatrix; + mat4 uncorrectedProjectionMatrix; + mat4 clipCorrectionMatrix; mat4 viewProjectionMatrix; mat4 inverseViewMatrix; mat4 inverseProjectionMatrix; @@ -147,6 +149,8 @@ Entity { layout(std140, binding = 0) uniform qt3d_render_view_uniforms { mat4 viewMatrix; mat4 projectionMatrix; + mat4 uncorrectedProjectionMatrix; + mat4 clipCorrectionMatrix; mat4 viewProjectionMatrix; mat4 inverseViewMatrix; mat4 inverseProjectionMatrix; |