examples/lib/three.js
function updateVirtualLight( light, cascade ) {

		var virtualLight = light.shadowCascadeArray[ cascade ];

		virtualLight.position.copy( light.position );
		virtualLight.target.position.copy( light.target.position );
		virtualLight.lookAt( virtualLight.target );

		virtualLight.shadowCameraVisible = light.shadowCameraVisible;
		virtualLight.shadowDarkness = light.shadowDarkness;

		virtualLight.shadowBias = light.shadowCascadeBias[ cascade ];

		var nearZ = light.shadowCascadeNearZ[ cascade ];
		var farZ = light.shadowCascadeFarZ[ cascade ];

		var pointsFrustum = virtualLight.pointsFrustum;

		pointsFrustum[ 0 ].z = nearZ;
		pointsFrustum[ 1 ].z = nearZ;
		pointsFrustum[ 2 ].z = nearZ;
		pointsFrustum[ 3 ].z = nearZ;

		pointsFrustum[ 4 ].z = farZ;
		pointsFrustum[ 5 ].z = farZ;
		pointsFrustum[ 6 ].z = farZ;
		pointsFrustum[ 7 ].z = farZ;

	}
function updateVirtualLight( light, cascade ) {

		var virtualLight = light.shadowCascadeArray[ cascade ];

		virtualLight.position.copy( light.position );
		virtualLight.target.position.copy( light.target.position );
		virtualLight.lookAt( virtualLight.target );

		virtualLight.shadowCameraVisible = light.shadowCameraVisible;
		virtualLight.shadowDarkness = light.shadowDarkness;

		virtualLight.shadowBias = light.shadowCascadeBias[ cascade ];

		var nearZ = light.shadowCascadeNearZ[ cascade ];
		var farZ = light.shadowCascadeFarZ[ cascade ];

		var pointsFrustum = virtualLight.pointsFrustum;

		pointsFrustum[ 0 ].z = nearZ;
		pointsFrustum[ 1 ].z = nearZ;
		pointsFrustum[ 2 ].z = nearZ;
		pointsFrustum[ 3 ].z = nearZ;

		pointsFrustum[ 4 ].z = farZ;
		pointsFrustum[ 5 ].z = farZ;
		pointsFrustum[ 6 ].z = farZ;
		pointsFrustum[ 7 ].z = farZ;

	}
function updateVirtualLight ( light , cascade ) { var virtualLight = light . shadowCascadeArray [ cascade ] ; virtualLight . position . copy ( light . position ) ; virtualLight . target . position . copy ( light . target . position ) ; virtualLight . lookAt ( virtualLight . target ) ; virtualLight . shadowCameraVisible = light . shadowCameraVisible ; virtualLight . shadowDarkness = light . shadowDarkness ; virtualLight . shadowBias = light . shadowCascadeBias [ cascade ] ; var nearZ = light . shadowCascadeNearZ [ cascade ] ; var farZ = light . shadowCascadeFarZ [ cascade ] ; var pointsFrustum = virtualLight . pointsFrustum ; pointsFrustum [ 0 ] . z = nearZ ; pointsFrustum [ 1 ] . z = nearZ ; pointsFrustum [ 2 ] . z = nearZ ; pointsFrustum [ 3 ] . z = nearZ ; pointsFrustum [ 4 ] . z = farZ ; pointsFrustum [ 5 ] . z = farZ ; pointsFrustum [ 6 ] . z = farZ ; pointsFrustum [ 7 ] . z = farZ ; }
Synchronize virtual light with the original light
Synchronize virtual light with the original light