2
0
Mr.doob 8 жил өмнө
parent
commit
e16f1d8fea

+ 14 - 12
src/renderers/WebGLRenderer.js

@@ -1409,19 +1409,21 @@ function WebGLRenderer( parameters ) {
 
 
 					var camera2 = cameras[ j ];
 					var camera2 = cameras[ j ];
 					var bounds = camera2.bounds;
 					var bounds = camera2.bounds;
-					state.viewport(
-						_currentViewport.set(
-							bounds.x * _width * _pixelRatio, bounds.y * _height * _pixelRatio,
-							bounds.z * _width * _pixelRatio, bounds.w * _height * _pixelRatio
-						)
-					);
-					state.scissor(
-						_currentScissor.set(
-							bounds.x * _width * _pixelRatio, bounds.y * _height * _pixelRatio,
-							bounds.z * _width * _pixelRatio, bounds.w * _height * _pixelRatio
-						)
-					);
+
+					_currentViewport.set(
+						bounds.x * _width, bounds.y * _height,
+						bounds.z * _width, bounds.w * _height
+					).multiplyScalar( _pixelRatio );
+
+					_currentScissor.set(
+						bounds.x * _width, bounds.y * _height,
+						bounds.z * _width, bounds.w * _height
+					).multiplyScalar( _pixelRatio );
+
+					state.viewport( _currentViewport );
+					state.scissor( _currentScissor );
 					state.setScissorTest( true );
 					state.setScissorTest( true );
+
 					renderObject( object, scene, camera2, geometry, material, group );
 					renderObject( object, scene, camera2, geometry, material, group );
 
 
 				}
 				}