summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-08-20 13:39:26 +0200
committerGitHub <noreply@github.com>2019-08-20 13:39:26 +0200
commitf21371d7f4df40c9aeb39fc11ebf81a362048fad (patch)
treef2167f49f0d3aae4d5231c74fc9e157b5f5456e7 /drivers/gles3
parenta4377ca46534e6376ccf50ae1cbc0e607be252a1 (diff)
parent8fb80788dfd41345a5dc67cc5ffd23b9f024649f (diff)
Merge pull request #31419 from NeoSpark314/fix_oculusquest_panorama
changed the constant scale of cube_normal to -1.0 instead of -1000000…
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/shaders/copy.glsl4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gles3/shaders/copy.glsl b/drivers/gles3/shaders/copy.glsl
index 232b9ce7c0..1952e201aa 100644
--- a/drivers/gles3/shaders/copy.glsl
+++ b/drivers/gles3/shaders/copy.glsl
@@ -165,11 +165,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;