|
|
@@ -227,15 +227,6 @@ class PassNode extends TempNode {
|
|
|
*/
|
|
|
this.options = options;
|
|
|
|
|
|
- /**
|
|
|
- * The pass's pixel ratio. Will be kept automatically kept in sync with the renderer's pixel ratio.
|
|
|
- *
|
|
|
- * @private
|
|
|
- * @type {number}
|
|
|
- * @default 1
|
|
|
- */
|
|
|
- this._pixelRatio = 1;
|
|
|
-
|
|
|
/**
|
|
|
* The pass's pixel width. Will be kept automatically kept in sync with the renderer's width.
|
|
|
* @private
|
|
|
@@ -252,7 +243,7 @@ class PassNode extends TempNode {
|
|
|
*/
|
|
|
this._height = 1;
|
|
|
|
|
|
- const renderTarget = new RenderTarget( this._width * this._pixelRatio, this._height * this._pixelRatio, { type: HalfFloatType, ...options, } );
|
|
|
+ const renderTarget = new RenderTarget( this._width, this._height, { type: HalfFloatType, ...options, } );
|
|
|
renderTarget.texture.name = 'output';
|
|
|
|
|
|
let depthTexture = null;
|
|
|
@@ -792,13 +783,11 @@ class PassNode extends TempNode {
|
|
|
const { scene } = this;
|
|
|
|
|
|
let camera;
|
|
|
- let pixelRatio;
|
|
|
|
|
|
const outputRenderTarget = renderer.getOutputRenderTarget();
|
|
|
|
|
|
if ( outputRenderTarget && outputRenderTarget.isXRRenderTarget === true ) {
|
|
|
|
|
|
- pixelRatio = 1;
|
|
|
camera = renderer.xr.getCamera();
|
|
|
|
|
|
renderer.xr.updateCamera( camera );
|
|
|
@@ -808,14 +797,11 @@ class PassNode extends TempNode {
|
|
|
} else {
|
|
|
|
|
|
camera = this.camera;
|
|
|
- pixelRatio = renderer.getPixelRatio();
|
|
|
|
|
|
- renderer.getSize( _size );
|
|
|
+ renderer.getDrawingBufferSize( _size );
|
|
|
|
|
|
}
|
|
|
|
|
|
- this._pixelRatio = pixelRatio;
|
|
|
-
|
|
|
this.setSize( _size.width, _size.height );
|
|
|
|
|
|
const currentRenderTarget = renderer.getRenderTarget();
|
|
|
@@ -900,8 +886,8 @@ class PassNode extends TempNode {
|
|
|
this._width = width;
|
|
|
this._height = height;
|
|
|
|
|
|
- const effectiveWidth = Math.floor( this._width * this._pixelRatio * this._resolutionScale );
|
|
|
- const effectiveHeight = Math.floor( this._height * this._pixelRatio * this._resolutionScale );
|
|
|
+ const effectiveWidth = Math.floor( this._width * this._resolutionScale );
|
|
|
+ const effectiveHeight = Math.floor( this._height * this._resolutionScale );
|
|
|
|
|
|
this.renderTarget.setSize( effectiveWidth, effectiveHeight );
|
|
|
|
|
|
@@ -909,7 +895,7 @@ class PassNode extends TempNode {
|
|
|
|
|
|
if ( this._scissor !== null ) {
|
|
|
|
|
|
- this.renderTarget.scissor.copy( this._scissor ).multiplyScalar( this._pixelRatio * this._resolutionScale ).floor();
|
|
|
+ this.renderTarget.scissor.copy( this._scissor ).multiplyScalar( this._resolutionScale ).floor();
|
|
|
this.renderTarget.scissorTest = true;
|
|
|
|
|
|
} else {
|
|
|
@@ -922,7 +908,7 @@ class PassNode extends TempNode {
|
|
|
|
|
|
if ( this._viewport !== null ) {
|
|
|
|
|
|
- this.renderTarget.viewport.copy( this._viewport ).multiplyScalar( this._pixelRatio * this._resolutionScale ).floor();
|
|
|
+ this.renderTarget.viewport.copy( this._viewport ).multiplyScalar( this._resolutionScale ).floor();
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -997,19 +983,6 @@ class PassNode extends TempNode {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Sets the pixel ratio the pass's render target and updates the size.
|
|
|
- *
|
|
|
- * @param {number} pixelRatio - The pixel ratio to set.
|
|
|
- */
|
|
|
- setPixelRatio( pixelRatio ) {
|
|
|
-
|
|
|
- this._pixelRatio = pixelRatio;
|
|
|
-
|
|
|
- this.setSize( this._width, this._height );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Frees internal resources. Should be called when the node is no longer in use.
|
|
|
*/
|