summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHolger Dammertz <holger.dammertz@googlemail.com>2019-08-16 19:33:22 +0200
committerHolger Dammertz <holger.dammertz@googlemail.com>2019-08-17 14:01:55 +0200
commit8fb80788dfd41345a5dc67cc5ffd23b9f024649f (patch)
tree0d6593e0143cc1f8867c183856fad79ea272f5bd /drivers
parentde8ce3e625e74833aec6a5d165e7e82100a1dbf3 (diff)
changed the constant scale of cube_normal to -1.0 instead of -1000000.0; this fixes a rendering issue on oculus quest and does not change the computation as the vector is normalized afterwards.
Adapted the comment above the code to reflect the change made as it already mentioned that z could be set to 1.
Diffstat (limited to 'drivers')
-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;