diff --git a/examples/jsm/csm/CSMShadowNode.js b/examples/jsm/csm/CSMShadowNode.js index 57c42e0c0b64b8..4e2ae5b55c228d 100644 --- a/examples/jsm/csm/CSMShadowNode.js +++ b/examples/jsm/csm/CSMShadowNode.js @@ -574,8 +574,12 @@ class CSMShadowNode extends ShadowBaseNode { const light = this.lights[ i ]; const parent = light.parent; - parent.remove( light.target ); - parent.remove( light ); + if ( parent !== null ) { + + parent.remove( light.target ); + parent.remove( light ); + + } } diff --git a/src/nodes/display/PassNode.js b/src/nodes/display/PassNode.js index f6add436d0386a..a75f1fd4f9f0cb 100644 --- a/src/nodes/display/PassNode.js +++ b/src/nodes/display/PassNode.js @@ -886,8 +886,26 @@ class PassNode extends TempNode { this.renderTarget.setSize( effectiveWidth, effectiveHeight ); - if ( this._scissor !== null ) this.renderTarget.scissor.copy( this._scissor ); - if ( this._viewport !== null ) this.renderTarget.viewport.copy( this._viewport ); + // scissor + + if ( this._scissor !== null ) { + + this.renderTarget.scissor.copy( this._scissor ).multiplyScalar( this._pixelRatio * this._resolutionScale ).floor(); + this.renderTarget.scissorTest = true; + + } else { + + this.renderTarget.scissorTest = false; + + } + + // viewport + + if ( this._viewport !== null ) { + + this.renderTarget.viewport.copy( this._viewport ).multiplyScalar( this._pixelRatio * this._resolutionScale ).floor(); + + } } @@ -922,8 +940,6 @@ class PassNode extends TempNode { } - this._scissor.multiplyScalar( this._pixelRatio * this._resolutionScale ).floor(); - } } @@ -958,8 +974,6 @@ class PassNode extends TempNode { } - this._viewport.multiplyScalar( this._pixelRatio * this._resolutionScale ).floor(); - } }