diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-09-22 21:18:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-22 21:18:06 +0200 |
commit | 7174677fc8c8de2c24da508910368cb16b56199d (patch) | |
tree | 3ffc77cfbe67c1d5c5726ef4deef534b216d1d57 /drivers/gles2 | |
parent | 6149ed0296d0760ec2b4d30aa002dd3c1500ca5c (diff) | |
parent | 94b0240767597c23548684663f76f0b2d01fc0e4 (diff) |
Merge pull request #32259 from NeoSpark314/fix_stereo_cubemap_gles2
fix gles2 broken panorama sky on oculus quest
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/shaders/copy.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gles2/shaders/copy.glsl b/drivers/gles2/shaders/copy.glsl index 195db7c45f..aa967115da 100644 --- a/drivers/gles2/shaders/copy.glsl +++ b/drivers/gles2/shaders/copy.glsl @@ -144,11 +144,11 @@ void main() { #elif defined(USE_ASYM_PANO) // When an asymmetrical projection matrix is used (applicable for stereoscopic rendering i.e. VR) we need to do this calculation per fragment to get a perspective correct result. - // Note that we're ignoring the x-offset for IPD, with Z sufficiently in the distance it becomes neglectible, as a result we could probably just set cube_normal.z to -1. + // Asymmetrical projection means the center of projection is no longer in the center of the screen but shifted. // The Matrix[2][0] (= asym_proj.x) and Matrix[2][1] (= asym_proj.z) values are what provide the right shift in the image. vec3 cube_normal; - cube_normal.z = -1000000.0; + cube_normal.z = -1.0; cube_normal.x = (cube_normal.z * (-uv_interp.x - asym_proj.x)) / asym_proj.y; cube_normal.y = (cube_normal.z * (-uv_interp.y - asym_proj.z)) / asym_proj.a; cube_normal = mat3(sky_transform) * mat3(pano_transform) * cube_normal; |