summaryrefslogtreecommitdiff
path: root/drivers/gles2/shaders/scene.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2/shaders/scene.glsl')
-rw-r--r--drivers/gles2/shaders/scene.glsl7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index 15b90a7771..30dc55cc4c 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -84,6 +84,8 @@ uniform highp mat4 world_transform;
uniform highp float time;
+uniform highp vec2 viewport_size;
+
#ifdef RENDER_DEPTH
uniform float light_bias;
uniform float light_normal_bias;
@@ -677,6 +679,8 @@ uniform highp mat4 world_transform;
uniform highp float time;
+uniform highp vec2 viewport_size;
+
#if defined(SCREEN_UV_USED)
uniform vec2 screen_pixel_size;
#endif
@@ -1380,6 +1384,7 @@ void main() {
discard;
#endif
highp vec3 vertex = vertex_interp;
+ vec3 view = -normalize(vertex_interp);
vec3 albedo = vec3(1.0);
vec3 transmission = vec3(0.0);
float metallic = 0.0;
@@ -1453,7 +1458,7 @@ FRAGMENT_SHADER_CODE
vec3 diffuse_light = vec3(0.0, 0.0, 0.0);
vec3 ambient_light = vec3(0.0, 0.0, 0.0);
- vec3 eye_position = -normalize(vertex_interp);
+ vec3 eye_position = view;
#if defined(ALPHA_SCISSOR_USED)
if (alpha < alpha_scissor) {