diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2023-02-21 07:16:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 07:16:21 +0100 |
commit | d68cfb43efa3790a71c63610acee7f63ac3d2e00 (patch) | |
tree | 1aa4ecb25ef93ff3629ae11515ec3ddb00b6f155 /drivers | |
parent | c71fea446746889c123c5abc280c551b9f383133 (diff) | |
parent | 2852c9c319f96ec2e74cba6fc69e86ca499ac2d7 (diff) |
Merge pull request #73662 from BastiaanOlij/fix_opengl_wobbly_sky
Fix wobbly sky in stereoscopic OpenGL
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles3/shaders/sky.glsl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gles3/shaders/sky.glsl b/drivers/gles3/shaders/sky.glsl index e59bca8b07..2455ffb8e2 100644 --- a/drivers/gles3/shaders/sky.glsl +++ b/drivers/gles3/shaders/sky.glsl @@ -21,12 +21,13 @@ out vec2 uv_interp; /* clang-format on */ void main() { - uv_interp = vertex_attrib; #ifdef USE_INVERTED_Y - gl_Position = vec4(uv_interp, 1.0, 1.0); + uv_interp = vertex_attrib; #else - gl_Position = vec4(uv_interp.x, uv_interp.y * -1.0, 1.0, 1.0); + // We're doing clockwise culling so flip the order + uv_interp = vec2(vertex_attrib.x, vertex_attrib.y * -1.0); #endif + gl_Position = vec4(uv_interp, 1.0, 1.0); } /* clang-format off */ @@ -145,9 +146,6 @@ void main() { cube_normal.x = (uv_interp.x + projection.x) / projection.y; cube_normal.y = (-uv_interp.y - projection.z) / projection.w; #endif -#ifndef USE_INVERTED_Y - cube_normal.y *= -1.0; -#endif cube_normal = mat3(orientation) * cube_normal; cube_normal = normalize(cube_normal); |