From bac10311bcb6ac47c71a6932bbcfcc8eb5dc30bf Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 8 Apr 2020 09:00:08 +0200 Subject: [PATCH] Follow-up of c887ecfefaeb627f656f4bc007f897b027dcf90a -> Removed unneded assignements from shaders --- resources/shaders/gouraud.vs | 4 +--- resources/shaders/variable_layer_height.vs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/resources/shaders/gouraud.vs b/resources/shaders/gouraud.vs index a790b5d9e..2644d48e4 100644 --- a/resources/shaders/gouraud.vs +++ b/resources/shaders/gouraud.vs @@ -62,10 +62,8 @@ void main() float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0); intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE; - intensity.y = 0.0; - vec3 position = (gl_ModelViewMatrix * gl_Vertex).xyz; - intensity.y += LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS); + intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS); // Perform the same lighting calculation for the 2nd light source (no specular applied). NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0); diff --git a/resources/shaders/variable_layer_height.vs b/resources/shaders/variable_layer_height.vs index 221cb5407..0e966b081 100644 --- a/resources/shaders/variable_layer_height.vs +++ b/resources/shaders/variable_layer_height.vs @@ -32,10 +32,8 @@ void main() float NdotL = max(dot(normal, LIGHT_TOP_DIR), 0.0); intensity.x = INTENSITY_AMBIENT + NdotL * LIGHT_TOP_DIFFUSE; - intensity.y = 0.0; - vec3 position = (gl_ModelViewMatrix * gl_Vertex).xyz; - intensity.y += LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS); + intensity.y = LIGHT_TOP_SPECULAR * pow(max(dot(-normalize(position), reflect(-LIGHT_TOP_DIR, normal)), 0.0), LIGHT_TOP_SHININESS); // Perform the same lighting calculation for the 2nd light source (no specular) NdotL = max(dot(normal, LIGHT_FRONT_DIR), 0.0);