From 3859c58a8a0c31111c4be4a1a7612c6fccabcab1 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 17 Feb 2016 02:04:30 +0100 Subject: [PATCH] Assign gl_ClipVertex in the vertex shader to make clip planes work --- files/shaders/objects_vertex.glsl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/files/shaders/objects_vertex.glsl b/files/shaders/objects_vertex.glsl index 679abda1d..fadbd9898 100644 --- a/files/shaders/objects_vertex.glsl +++ b/files/shaders/objects_vertex.glsl @@ -10,10 +10,8 @@ varying vec3 lighting; #define MAX_LIGHTS 8 -vec3 doLighting(vec4 vertex, vec3 normal, vec3 vertexColor) +vec3 doLighting(vec3 viewPos, vec3 viewNormal, vec3 vertexColor) { - vec3 viewPos = (gl_ModelViewMatrix * vertex).xyz; - vec3 viewNormal = normalize((gl_NormalMatrix * normal).xyz); vec3 lightDir; float d; @@ -28,7 +26,7 @@ vec3 doLighting(vec4 vertex, vec3 normal, vec3 vertexColor) vec3 lightResult = vec3(0.0, 0.0, 0.0); for (int i=0; i