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.
This commit is contained in:
parent
de8ce3e625
commit
8fb80788df
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user