提交 80e542c6 编写于 作者: W WestLangley

WebGLRenderer: Revert y swap to setViewport() and setScissor()

上级 4923ad17
......@@ -37,7 +37,7 @@
for ( var x = 0; x < AMOUNT; x ++ ) {
var subcamera = new THREE.PerspectiveCamera( 40, ASPECT_RATIO, 0.1, 10 );
subcamera.bounds = new THREE.Vector4( x / AMOUNT, y / AMOUNT, SIZE, SIZE );
subcamera.bounds = new THREE.Vector4( x / AMOUNT, 1 - ( ( y + 1 ) / AMOUNT ), SIZE, SIZE );
subcamera.position.x = ( x / AMOUNT ) - 0.5;
subcamera.position.y = 0.5 - ( y / AMOUNT );
subcamera.position.z = 1.5;
......
......@@ -194,9 +194,9 @@
renderer.setScissorTest( true );
renderer.setScissor( 20, window.innerHeight - insetHeight - 20, insetWidth, insetHeight );
renderer.setScissor( 20, 20, insetWidth, insetHeight );
renderer.setViewport( 20, window.innerHeight - insetHeight - 20, insetWidth, insetHeight );
renderer.setViewport( 20, 20, insetWidth, insetHeight );
renderer.render( scene, camera );
......
......@@ -218,10 +218,10 @@
var width = rect.right - rect.left;
var height = rect.bottom - rect.top;
var left = rect.left;
var top = rect.top;
var bottom = renderer.domElement.clientHeight - rect.bottom;
renderer.setViewport( left, top, width, height );
renderer.setScissor( left, top, width, height );
renderer.setViewport( left, bottom, width, height );
renderer.setScissor( left, bottom, width, height );
var camera = scene.userData.camera;
......
......@@ -246,10 +246,10 @@
var width = rect.right - rect.left;
var height = rect.bottom - rect.top;
var left = rect.left;
var top = rect.top;
var bottom = renderer.domElement.clientHeight - rect.bottom;
renderer.setViewport( left, top, width, height );
renderer.setScissor( left, top, width, height );
renderer.setViewport( left, bottom, width, height );
renderer.setScissor( left, bottom, width, height );
renderer.render( scene, scene.userData.camera );
......
......@@ -53,7 +53,7 @@
var views = [
{
left: 0,
top: 0,
bottom: 0,
width: 0.5,
height: 1.0,
background: new THREE.Color( 0.5, 0.5, 0.7 ),
......@@ -68,7 +68,7 @@
},
{
left: 0.5,
top: 0.5,
bottom: 0.5,
width: 0.5,
height: 0.5,
background: new THREE.Color( 0.7, 0.5, 0.5 ),
......@@ -83,7 +83,7 @@
},
{
left: 0.5,
top: 0,
bottom: 0,
width: 0.5,
height: 0.5,
background: new THREE.Color( 0.5, 0.7, 0.7 ),
......@@ -275,12 +275,12 @@
view.updateCamera( camera, scene, mouseX, mouseY );
var left = Math.floor( windowWidth * view.left );
var top = Math.floor( windowHeight * view.top );
var bottom = Math.floor( windowHeight * view.bottom );
var width = Math.floor( windowWidth * view.width );
var height = Math.floor( windowHeight * view.height );
renderer.setViewport( left, top, width, height );
renderer.setScissor( left, top, width, height );
renderer.setViewport( left, bottom, width, height );
renderer.setScissor( left, bottom, width, height );
renderer.setScissorTest( true );
renderer.setClearColor( view.background );
......
......@@ -409,14 +409,14 @@ function WebGLRenderer( parameters ) {
this.setViewport = function ( x, y, width, height ) {
_viewport.set( x, _height - y - height, width, height );
_viewport.set( x, y, width, height );
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );
};
this.setScissor = function ( x, y, width, height ) {
_scissor.set( x, _height - y - height, width, height );
_scissor.set( x, y, width, height );
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) );
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册