Browse Source

Merge pull request #5866 from greggman/fix-stereo

Fix StereoEffect so it actually clips correctly
Mr.doob 10 năm trước cách đây
mục cha
commit
1bd906938a
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      examples/js/effects/StereoEffect.js

+ 5 - 1
examples/js/effects/StereoEffect.js

@@ -122,15 +122,19 @@ THREE.StereoEffect = function ( renderer ) {
 
 		//
 
-		renderer.setViewport( 0, 0, _width * 2, _height );
 		renderer.clear();
+		renderer.enableScissorTest( true );
 
+		renderer.setScissor( 0, 0, _width, _height );
 		renderer.setViewport( 0, 0, _width, _height );
 		renderer.render( scene, _cameraL );
 
+		renderer.setScissor( _width, 0, _width, _height );
 		renderer.setViewport( _width, 0, _width, _height );
 		renderer.render( scene, _cameraR );
 
+		renderer.enableScissorTest( false );
+
 	};
 
 };