Browse Source

WebGLRenderer: renderState lights needs to be updated per ArrayCamera's subcamera.

Mr.doob 7 years ago
parent
commit
c2a469a9c7
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/renderers/WebGLRenderer.js

+ 5 - 5
src/renderers/WebGLRenderer.js

@@ -1366,6 +1366,8 @@ function WebGLRenderer( parameters ) {
 
 						}
 
+						currentRenderState.setupLights( camera2 );
+
 						renderObject( object, scene, camera2, geometry, material, group );
 
 					}
@@ -1691,7 +1693,7 @@ function WebGLRenderer( parameters ) {
 
 		}
 
-		if ( refreshProgram || camera !== _currentCamera ) {
+		if ( refreshProgram || _currentCamera !== camera ) {
 
 			p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );
 
@@ -1702,11 +1704,9 @@ function WebGLRenderer( parameters ) {
 
 			}
 
-			// Avoid unneeded uniform updates per ArrayCamera's sub-camera
-
-			if ( _currentCamera !== ( _currentArrayCamera || camera ) ) {
+			if ( _currentCamera !== camera ) {
 
-				_currentCamera = ( _currentArrayCamera || camera );
+				_currentCamera = camera;
 
 				// lighting uniforms depend on the camera so enforce an update
 				// now, in case this material supports lights - or later, when