Skip to content

Commit

Permalink
WebGLRenderer: Added y swap to setViewport() and setScissor().
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 7, 2017
1 parent 0df6403 commit 43ae8e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,14 @@ function WebGLRenderer( parameters ) {

this.setViewport = function ( x, y, width, height ) {

_viewport.set( x, y, width, height )
_viewport.set( x, _height - y - height, width, height )
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );

};

this.setScissor = function ( x, y, width, height ) {

_scissor.set( x, y, width, height )
_scissor.set( x, _height - y - height, width, height )
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) );

};
Expand Down Expand Up @@ -1082,7 +1082,7 @@ function WebGLRenderer( parameters ) {
// Rendering

this.render = function ( scene, camera, renderTarget, forceClear ) {

if ( ! ( camera && camera.isCamera ) ) {

console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );
Expand Down

0 comments on commit 43ae8e4

Please sign in to comment.