Browse Source

shadowmap_vertex: these directives are not needed, the loop unroller will take care of it.

Mr.doob 9 years ago
parent
commit
9e6b3e1fce
1 changed files with 9 additions and 21 deletions
  1. 9 21
      src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl

+ 9 - 21
src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl

@@ -1,33 +1,21 @@
 #ifdef USE_SHADOWMAP
 
-	#if NUM_DIR_LIGHTS > 0
+	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
 
-		for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
+		vDirectionalShadowCoord[ i ] = directionalLights[ i ].shadowMatrix * worldPosition;
 
-			vDirectionalShadowCoord[ i ] = directionalLights[ i ].shadowMatrix * worldPosition;
+	}
 
-		}
+	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
 
-	#endif
+		vSpotShadowCoord[ i ] = spotLights[ i ].shadowMatrix * worldPosition;
 
-	#if NUM_SPOT_LIGHTS > 0
+	}
 
-		for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
+	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
 
-			vSpotShadowCoord[ i ] = spotLights[ i ].shadowMatrix * worldPosition;
+		vPointShadowCoord[ i ] = pointLights[ i ].shadowMatrix * worldPosition;
 
-		}
-
-	#endif
-
-	#if NUM_POINT_LIGHTS > 0
-
-		for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
-
-			vPointShadowCoord[ i ] = pointLights[ i ].shadowMatrix * worldPosition;
-
-		}
-
-	#endif
+	}
 
 #endif