Browse Source

Follow-up of c887ecfefaeb627f656f4bc007f897b027dcf90a -> Removed unneded assignements from shaders

enricoturri1966 5 years ago
parent
commit
bac10311bc
2 changed files with 2 additions and 6 deletions
  1. 1 3
      resources/shaders/gouraud.vs
  2. 1 3
      resources/shaders/variable_layer_height.vs

+ 1 - 3
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);

+ 1 - 3
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);