Pārlūkot izejas kodu

ShadowMaps: Reverted to use structs when possible.

Mr.doob 9 gadi atpakaļ
vecāks
revīzija
363648ed47

+ 0 - 1
examples/js/loaders/MMDLoader.js

@@ -3636,7 +3636,6 @@ THREE.ShaderLib[ 'mmd' ] = {
 		THREE.UniformsLib[ "fog" ],
 		THREE.UniformsLib[ "ambient" ],
 		THREE.UniformsLib[ "lights" ],
-		THREE.UniformsLib[ "shadowmap" ],
 
 		{
 			"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },

+ 41 - 94
src/renderers/WebGLRenderer.js

@@ -119,35 +119,16 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		ambient: [ 0, 0, 0 ],
 		directional: [],
+		directionalShadowMap: [],
+		directionalShadowMatrix: [],
 		spot: [],
+		spotShadowMap: [],
+		spotShadowMatrix: [],
 		point: [],
+		pointShadowMap: [],
+		pointShadowMatrix: [],
 		hemi: [],
 
-		directionalShadow: {
-			enabled: [],
-			map: [],
-			mapSize: [],
-			bias: [],
-			radius: [],
-			matrix: []
-		},
-		spotShadow: {
-			enabled: [],
-			map: [],
-			mapSize: [],
-			bias: [],
-			radius: [],
-			matrix: []
-		},
-		pointShadow: {
-			enabled: [],
-			map: [],
-			mapSize: [],
-			bias: [],
-			radius: [],
-			matrix: []
-		},
-
 		shadows: [],
 		shadowsPointLight: 0
 
@@ -1549,30 +1530,12 @@ THREE.WebGLRenderer = function ( parameters ) {
 			uniforms.pointLights.value = _lights.point;
 			uniforms.hemisphereLights.value = _lights.hemi;
 
-			if ( shadowMap.enabled === true ) {
-
-				uniforms.directionalShadow.value = _lights.directionalShadow.enabled;
-				uniforms.directionalShadowMap.value = _lights.directionalShadow.map;
-				uniforms.directionalShadowMapSize.value = _lights.directionalShadow.mapSize;
-				uniforms.directionalShadowBias.value = _lights.directionalShadow.bias;
-				uniforms.directionalShadowRadius.value = _lights.directionalShadow.radius;
-				uniforms.directionalShadowMatrix.value = _lights.directionalShadow.matrix;
-
-				uniforms.spotShadow.value = _lights.spotShadow.enabled;
-				uniforms.spotShadowMap.value = _lights.spotShadow.map;
-				uniforms.spotShadowMapSize.value = _lights.spotShadow.mapSize;
-				uniforms.spotShadowBias.value = _lights.spotShadow.bias;
-				uniforms.spotShadowRadius.value = _lights.spotShadow.radius;
-				uniforms.spotShadowMatrix.value = _lights.spotShadow.matrix;
-
-				uniforms.pointShadow.value = _lights.pointShadow.enabled;
-				uniforms.pointShadowMap.value = _lights.pointShadow.map;
-				uniforms.pointShadowMapSize.value = _lights.pointShadow.mapSize;
-				uniforms.pointShadowBias.value = _lights.pointShadow.bias;
-				uniforms.pointShadowRadius.value = _lights.pointShadow.radius;
-				uniforms.pointShadowMatrix.value = _lights.pointShadow.matrix;
-
-			}
+			uniforms.directionalShadowMap.value = _lights.directionalShadowMap;
+			uniforms.directionalShadowMatrix.value = _lights.directionalShadowMatrix;
+			uniforms.spotShadowMap.value = _lights.spotShadowMap;
+			uniforms.spotShadowMatrix.value = _lights.spotShadowMatrix;
+			uniforms.pointShadowMap.value = _lights.pointShadowMap;
+			uniforms.pointShadowMatrix.value = _lights.pointShadowMatrix;
 
 		}
 
@@ -2701,26 +2664,26 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				var uniforms = lightCache.get( light );
 
+				uniforms.color.copy( light.color ).multiplyScalar( light.intensity );
 				uniforms.direction.setFromMatrixPosition( light.matrixWorld );
 				_vector3.setFromMatrixPosition( light.target.matrixWorld );
 				uniforms.direction.sub( _vector3 );
 				uniforms.direction.transformDirection( viewMatrix );
-				uniforms.color.copy( light.color ).multiplyScalar( light.intensity );
 
-				_lights.directionalShadow.enabled[ directionalLength ] = light.castShadow;
+				uniforms.shadow = light.castShadow;
 
 				if ( light.castShadow ) {
 
-					_lights.directionalShadow.map[ directionalLength ] = light.shadow.map;
-					_lights.directionalShadow.mapSize[ directionalLength ] = light.shadow.mapSize;
-					_lights.directionalShadow.bias[ directionalLength ] = light.shadow.bias;
-					_lights.directionalShadow.radius[ directionalLength ] = light.shadow.radius;
-					_lights.directionalShadow.matrix[ directionalLength ] = light.shadow.matrix;
+					uniforms.shadowBias = light.shadow.bias;
+					uniforms.shadowRadius = light.shadow.radius;
+					uniforms.shadowMapSize = light.shadow.mapSize;
 
 					_lights.shadows[ shadowsLength ++ ] = light;
 
 				}
 
+				_lights.directionalShadowMap[ directionalLength ] = light.shadow.map;
+				_lights.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix;
 				_lights.directional[ directionalLength ++ ] = uniforms;
 
 			} else if ( light instanceof THREE.SpotLight ) {
@@ -2742,20 +2705,20 @@ THREE.WebGLRenderer = function ( parameters ) {
 				uniforms.exponent = light.exponent;
 				uniforms.decay = ( light.distance === 0 ) ? 0.0 : light.decay;
 
-				_lights.spotShadow.enabled[ spotLength ] = light.castShadow;
+				uniforms.shadow = light.castShadow;
 
 				if ( light.castShadow ) {
 
-					_lights.spotShadow.map[ spotLength ] = light.shadow.map;
-					_lights.spotShadow.mapSize[ spotLength ] = light.shadow.mapSize;
-					_lights.spotShadow.bias[ spotLength ] = light.shadow.bias;
-					_lights.spotShadow.radius[ spotLength ] = light.shadow.radius;
-					_lights.spotShadow.matrix[ spotLength ] = light.shadow.matrix;
+					uniforms.shadowBias = light.shadow.bias;
+					uniforms.shadowRadius = light.shadow.radius;
+					uniforms.shadowMapSize = light.shadow.mapSize;
 
 					_lights.shadows[ shadowsLength ++ ] = light;
 
 				}
 
+				_lights.spotShadowMap[ spotLength ] = light.shadow.map;
+				_lights.spotShadowMatrix[ spotLength ] = light.shadow.matrix;
 				_lights.spot[ spotLength ++ ] = uniforms;
 
 			} else if ( light instanceof THREE.PointLight ) {
@@ -2769,26 +2732,31 @@ THREE.WebGLRenderer = function ( parameters ) {
 				uniforms.distance = light.distance;
 				uniforms.decay = ( light.distance === 0 ) ? 0.0 : light.decay;
 
-				_lights.pointShadow.enabled[ pointLength ] = light.castShadow;
+				uniforms.shadow = light.castShadow;
 
 				if ( light.castShadow ) {
 
-					_lights.pointShadow.map[ pointLength ] = light.shadow.map;
-					_lights.pointShadow.mapSize[ pointLength ] = light.shadow.mapSize;
-					_lights.pointShadow.bias[ pointLength ] = light.shadow.bias;
-					_lights.pointShadow.radius[ pointLength ] = light.shadow.radius;
+					uniforms.shadowBias = light.shadow.bias;
+					uniforms.shadowRadius = light.shadow.radius;
+					uniforms.shadowMapSize = light.shadow.mapSize;
+
+					_lights.shadows[ shadowsLength ++ ] = light;
 
-					// for point lights we set the shadow matrix to be a translation-only matrix
-					// equal to inverse of the light's position
-					_vector3.setFromMatrixPosition( light.matrixWorld ).negate();
-					// light.shadow.matrix.identity().setPosition( _vector3 );
+				}
 
-					_lights.pointShadow.matrix[ pointLength ] = new THREE.Matrix4().setPosition( _vector3 ); // light.shadow.matrix;
+				_lights.pointShadowMap[ pointLength ] = light.shadow.map;
 
-					_lights.shadows[ shadowsLength ++ ] = light;
+				if ( _lights.pointShadowMatrix[ pointLength ] === undefined ) {
+
+					_lights.pointShadowMatrix[ pointLength ] = new THREE.Matrix4();
 
 				}
 
+				// for point lights we set the shadow matrix to be a translation-only matrix
+				// equal to inverse of the light's position
+				_vector3.setFromMatrixPosition( light.matrixWorld ).negate();
+				_lights.pointShadowMatrix[ pointLength ].identity().setPosition( _vector3 );
+
 				_lights.point[ pointLength ++ ] = uniforms;
 
 			} else if ( light instanceof THREE.HemisphereLight ) {
@@ -2819,27 +2787,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		_lights.shadows.length = shadowsLength;
 
-		_lights.directionalShadow.enabled.length = directionalLength;
-		_lights.directionalShadow.map.length = directionalLength;
-		_lights.directionalShadow.mapSize.length = directionalLength;
-		_lights.directionalShadow.bias.length = directionalLength;
-		_lights.directionalShadow.radius.length = directionalLength;
-		_lights.directionalShadow.matrix.length = directionalLength;
-
-		_lights.spotShadow.enabled.length = spotLength;
-		_lights.spotShadow.map.length = spotLength;
-		_lights.spotShadow.mapSize.length = spotLength;
-		_lights.spotShadow.bias.length = spotLength;
-		_lights.spotShadow.radius.length = spotLength;
-		_lights.spotShadow.matrix.length = spotLength;
-
-		_lights.pointShadow.enabled.length = pointLength;
-		_lights.pointShadow.map.length = pointLength;
-		_lights.pointShadow.mapSize.length = pointLength;
-		_lights.pointShadow.bias.length = pointLength;
-		_lights.pointShadow.radius.length = pointLength;
-		_lights.pointShadow.matrix.length = pointLength;
-
 		_lights.hash = directionalLength + ',' + pointLength + ',' + spotLength + ',' + hemiLength + ',' + shadowsLength;
 
 	}

+ 0 - 53
src/renderers/shaders/ShaderChunk/common.glsl

@@ -31,59 +31,6 @@ struct GeometricContext {
 };
 
 
-#if NUM_DIR_LIGHTS > 0
-
-	struct DirectionalLight {
-		vec3 direction;
-		vec3 color;
-	};
-
-	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
-
-#endif
-
-#if NUM_SPOT_LIGHTS > 0
-
-	struct SpotLight {
-		vec3 position;
-		vec3 direction;
-		vec3 color;
-		float distance;
-		float decay;
-		float angleCos;
-		float exponent;
-	};
-
-	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
-
-#endif
-
-#if NUM_POINT_LIGHTS > 0
-
-	struct PointLight {
-		vec3 position;
-		vec3 color;
-		float distance;
-		float decay;
-	};
-
-	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
-
-#endif
-
-#if NUM_HEMI_LIGHTS > 0
-
-	struct HemisphereLight {
-		vec3 direction;
-		vec3 skyColor;
-		vec3 groundColor;
-	};
-
-	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
-
-#endif
-
-
 vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
 
 	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

+ 51 - 0
src/renderers/shaders/ShaderChunk/lights_pars.glsl

@@ -1,5 +1,17 @@
 #if NUM_DIR_LIGHTS > 0
 
+	struct DirectionalLight {
+		vec3 direction;
+		vec3 color;
+
+		int shadow;
+		float shadowBias;
+		float shadowRadius;
+		vec2 shadowMapSize;
+	};
+
+	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
+
 	IncidentLight getDirectionalDirectLight( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {
 
 		IncidentLight directLight;
@@ -16,6 +28,20 @@
 
 #if NUM_POINT_LIGHTS > 0
 
+	struct PointLight {
+		vec3 position;
+		vec3 color;
+		float distance;
+		float decay;
+
+		int shadow;
+		float shadowBias;
+		float shadowRadius;
+		vec2 shadowMapSize;
+	};
+
+	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
+
 	IncidentLight getPointDirectLight( const in PointLight pointLight, const in GeometricContext geometry ) {
 
 		IncidentLight directLight;
@@ -35,6 +61,23 @@
 
 #if NUM_SPOT_LIGHTS > 0
 
+	struct SpotLight {
+		vec3 position;
+		vec3 direction;
+		vec3 color;
+		float distance;
+		float decay;
+		float angleCos;
+		float exponent;
+
+		int shadow;
+		float shadowBias;
+		float shadowRadius;
+		vec2 shadowMapSize;
+	};
+
+	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
+
 	IncidentLight getSpotDirectLight( const in SpotLight spotLight, const in GeometricContext geometry ) {
 
 		IncidentLight directLight;
@@ -67,6 +110,14 @@
 
 #if NUM_HEMI_LIGHTS > 0
 
+	struct HemisphereLight {
+		vec3 direction;
+		vec3 skyColor;
+		vec3 groundColor;
+	};
+
+	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
+
 	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {
 
 		float dotNL = dot( geometry.normal, hemiLight.direction );

+ 3 - 3
src/renderers/shaders/ShaderChunk/lights_template.glsl

@@ -32,7 +32,7 @@ IncidentLight directLight;
 		directLight = getPointDirectLight( pointLight, geometry );
 
 		#ifdef USE_SHADOWMAP
-		directLight.color *= pointShadow[ i ] ? getPointShadow( pointShadowMap[ i ], pointShadowMapSize[ i ], pointShadowBias[ i ], pointShadowRadius[ i ], vPointShadowCoord[ i ] ) : 1.0;
+		directLight.color *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;
 		#endif
 
 		RE_Direct( directLight, geometry, material, reflectedLight );
@@ -52,7 +52,7 @@ IncidentLight directLight;
 		directLight = getSpotDirectLight( spotLight, geometry );
 
 		#ifdef USE_SHADOWMAP
-		directLight.color *= spotShadow[ i ] ? getShadow( spotShadowMap[ i ], spotShadowMapSize[ i ], spotShadowBias[ i ], spotShadowRadius[ i ], vSpotShadowCoord[ i ] ) : 1.0;
+		directLight.color *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
 		#endif
 
 		RE_Direct( directLight, geometry, material, reflectedLight );
@@ -72,7 +72,7 @@ IncidentLight directLight;
 		directLight = getDirectionalDirectLight( directionalLight, geometry );
 
 		#ifdef USE_SHADOWMAP
-		directLight.color *= directionalShadow[ i ] ? getShadow( directionalShadowMap[ i ], directionalShadowMapSize[ i ], directionalShadowBias[ i ], directionalShadowRadius[ i ], vDirectionalShadowCoord[ i ] ) : 1.0;
+		directLight.color *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
 		#endif
 
 		RE_Direct( directLight, geometry, material, reflectedLight );

+ 0 - 15
src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl

@@ -2,36 +2,21 @@
 
 	#if NUM_DIR_LIGHTS > 0
 
-		uniform bool directionalShadow[ NUM_DIR_LIGHTS ];
 		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];
-		uniform vec2 directionalShadowMapSize[ NUM_DIR_LIGHTS ];
-		uniform float directionalShadowBias[ NUM_DIR_LIGHTS ];
-		uniform float directionalShadowRadius[ NUM_DIR_LIGHTS ];
-
 		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];
 
 	#endif
 
 	#if NUM_SPOT_LIGHTS > 0
 
-		uniform bool spotShadow[ NUM_SPOT_LIGHTS ];
 		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];
-		uniform vec2 spotShadowMapSize[ NUM_SPOT_LIGHTS ];
-		uniform float spotShadowBias[ NUM_SPOT_LIGHTS ];
-		uniform float spotShadowRadius[ NUM_SPOT_LIGHTS ];
-
 		varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];
 
 	#endif
 
 	#if NUM_POINT_LIGHTS > 0
 
-		uniform bool pointShadow[ NUM_POINT_LIGHTS ];
 		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];
-		uniform vec2 pointShadowMapSize[ NUM_POINT_LIGHTS ];
-		uniform float pointShadowBias[ NUM_POINT_LIGHTS ];
-		uniform float pointShadowRadius[ NUM_POINT_LIGHTS ];
-
 		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];
 
 	#endif

+ 3 - 3
src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl

@@ -2,11 +2,11 @@
 
 	#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 ] = directionalShadowMatrix[ i ] * worldPosition;
+		vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;
 
-		}
+	}
 
 	#endif
 

+ 0 - 2
src/renderers/shaders/ShaderLib.js

@@ -284,7 +284,6 @@ THREE.ShaderLib = {
 			THREE.UniformsLib[ "fog" ],
 			THREE.UniformsLib[ "ambient" ],
 			THREE.UniformsLib[ "lights" ],
-			THREE.UniformsLib[ "shadowmap" ],
 
 			{
 				"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },
@@ -438,7 +437,6 @@ THREE.ShaderLib = {
 			THREE.UniformsLib[ "fog" ],
 			THREE.UniformsLib[ "ambient" ],
 			THREE.UniformsLib[ "lights" ],
-			THREE.UniformsLib[ "shadowmap" ],
 
 			{
 				"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },

+ 27 - 28
src/renderers/shaders/UniformsLib.js

@@ -95,9 +95,17 @@ THREE.UniformsLib = {
 
 		"directionalLights": { type: "sa", value: [], properties: {
 			"direction": { type: "v3" },
-			"color": { type: "c" }
+			"color": { type: "c" },
+
+			"shadow": { type: "i" },
+			"shadowBias": { type: "f" },
+			"shadowRadius": { type: "f" },
+			"shadowMapSize": { type: "v2" }
 		} },
 
+		"directionalShadowMap": { type: "tv", value: [] },
+		"directionalShadowMatrix": { type: "m4v", value: [] },
+
 		"spotLights": { type: "sa", value: [], properties: {
 			"color": { type: "c" },
 			"position": { type: "v3" },
@@ -105,16 +113,32 @@ THREE.UniformsLib = {
 			"distance": { type: "f" },
 			"angleCos": { type: "f" },
 			"exponent": { type: "f" },
-			"decay": { type: "f" }
+			"decay": { type: "f" },
+
+			"shadow": { type: "i" },
+			"shadowBias": { type: "f" },
+			"shadowRadius": { type: "f" },
+			"shadowMapSize": { type: "v2" }
 		} },
 
+		"spotShadowMap": { type: "tv", value: [] },
+		"spotShadowMatrix": { type: "m4v", value: [] },
+
 		"pointLights": { type: "sa", value: [], properties: {
 			"color": { type: "c" },
 			"position": { type: "v3" },
 			"decay": { type: "f" },
-			"distance": { type: "f" }
+			"distance": { type: "f" },
+
+			"shadow": { type: "i" },
+			"shadowBias": { type: "f" },
+			"shadowRadius": { type: "f" },
+			"shadowMapSize": { type: "v2" }
 		} },
 
+		"pointShadowMap": { type: "tv", value: [] },
+		"pointShadowMatrix": { type: "m4v", value: [] },
+
 		"hemisphereLights": { type: "sa", value: [], properties: {
 			"direction": { type: "v3" },
 			"skyColor": { type: "c" },
@@ -132,31 +156,6 @@ THREE.UniformsLib = {
 		"map": { type: "t", value: null },
 		"offsetRepeat": { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) }
 
-	},
-
-	shadowmap: {
-
-		"directionalShadow": { type: "1iv", value: [] },
-		"directionalShadowMap": { type: "tv", value: [] },
-		"directionalShadowMapSize": { type: "v2v", value: [] },
-		"directionalShadowBias": { type: "1fv", value: [] },
-		"directionalShadowRadius": { type: "1fv", value: [] },
-		"directionalShadowMatrix": { type: "m4v", value: [] },
-
-		"spotShadow": { type: "1iv", value: [] },
-		"spotShadowMap": { type: "tv", value: [] },
-		"spotShadowMapSize": { type: "v2v", value: [] },
-		"spotShadowBias": { type: "1fv", value: [] },
-		"spotShadowRadius": { type: "1fv", value: [] },
-		"spotShadowMatrix": { type: "m4v", value: [] },
-
-		"pointShadow": { type: "1iv", value: [] },
-		"pointShadowMap": { type: "tv", value: [] },
-		"pointShadowMapSize": { type: "v2v", value: [] },
-		"pointShadowBias": { type: "1fv", value: [] },
-		"pointShadowRadius": { type: "1fv", value: [] },
-		"pointShadowMatrix": { type: "m4v", value: [] }
-
 	}
 
 };

+ 6 - 9
src/renderers/webgl/WebGLLights.js

@@ -23,11 +23,10 @@ THREE.WebGLLights = function () {
 					direction: new THREE.Vector3(),
 					color: new THREE.Color(),
 
-					shadowEnabled: false,
+					shadow: false,
 					shadowBias: 0,
 					shadowRadius: 1,
-					shadowMapSize: new THREE.Vector2(),
-					shadowMatrix: new THREE.Matrix4()
+					shadowMapSize: new THREE.Vector2()
 				};
 				break;
 
@@ -41,11 +40,10 @@ THREE.WebGLLights = function () {
 					exponent: 0,
 					decay: 0,
 
-					shadowEnabled: false,
+					shadow: false,
 					shadowBias: 0,
 					shadowRadius: 1,
-					shadowMapSize: new THREE.Vector2(),
-					shadowMatrix: new THREE.Matrix4()
+					shadowMapSize: new THREE.Vector2()
 				};
 				break;
 
@@ -56,11 +54,10 @@ THREE.WebGLLights = function () {
 					distance: 0,
 					decay: 0,
 
-					shadowEnabled: false,
+					shadow: false,
 					shadowBias: 0,
 					shadowRadius: 1,
-					shadowMapSize: new THREE.Vector2(),
-					shadowMatrix: new THREE.Matrix4()
+					shadowMapSize: new THREE.Vector2()
 				};
 				break;