summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders/copy.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/shaders/copy.glsl')
-rw-r--r--drivers/gles3/shaders/copy.glsl10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gles3/shaders/copy.glsl b/drivers/gles3/shaders/copy.glsl
index a5637537d2..3b36bc7cc1 100644
--- a/drivers/gles3/shaders/copy.glsl
+++ b/drivers/gles3/shaders/copy.glsl
@@ -79,6 +79,7 @@ uniform float multiplier;
#endif
#if defined(USE_PANORAMA) || defined(USE_ASYM_PANO)
+uniform highp mat4 sky_transform;
vec4 texturePanorama(vec3 normal, sampler2D pano) {
@@ -121,7 +122,12 @@ void main() {
#ifdef USE_PANORAMA
- vec4 color = texturePanorama(normalize(cube_interp), source);
+ vec3 cube_normal = normalize(cube_interp);
+ cube_normal.z = -cube_normal.z;
+ cube_normal = mat3(sky_transform) * cube_normal;
+ cube_normal.z = -cube_normal.z;
+
+ vec4 color = texturePanorama(cube_normal, source);
#elif defined(USE_ASYM_PANO)
@@ -133,7 +139,7 @@ void main() {
cube_normal.z = -1000000.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(pano_transform) * cube_normal;
+ cube_normal = mat3(sky_transform) * mat3(pano_transform) * cube_normal;
cube_normal.z = -cube_normal.z;
vec4 color = texturePanorama(normalize(cube_normal.xyz), source);