From 2042d6214e1ab302a1d9a0a4bd8a018bf6ee679b Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sat, 3 Nov 2018 11:35:46 -0700 Subject: make VIEW vector available in fragment --- drivers/gles2/shaders/scene.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/gles2/shaders/scene.glsl') diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index 2a781605d1..83f33fb67b 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -1392,6 +1392,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; @@ -1465,7 +1466,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) { -- cgit v1.2.3