summaryrefslogtreecommitdiff
path: root/drivers/gles2/shaders/scene.glsl
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-11 20:44:41 +0100
committerGitHub <noreply@github.com>2018-12-11 20:44:41 +0100
commit37e198c32006d18c9443bf65963ba8182b7d76a6 (patch)
tree79d4b605a628942a7aff3aa6bf599af0c63f54a8 /drivers/gles2/shaders/scene.glsl
parent1b038bed94519bddcc4328ca053874a754ae37fd (diff)
parent2042d6214e1ab302a1d9a0a4bd8a018bf6ee679b (diff)
Merge pull request #23483 from clayjohn/fragment_camera_view
Make VIEW vector available in fragment shader
Diffstat (limited to 'drivers/gles2/shaders/scene.glsl')
-rw-r--r--drivers/gles2/shaders/scene.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index d728ad5da6..30dc55cc4c 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -1384,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;
@@ -1457,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) {