Просмотр исходного кода

Nodes: Fix size computations in FX/RTT nodes. (#32077)

Michael Herzog 2 месяцев назад
Родитель
Сommit
97b4c515bc
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      src/nodes/display/PassNode.js
  2. 2 2
      src/nodes/utils/RTTNode.js

+ 2 - 2
src/nodes/display/PassNode.js

@@ -786,8 +786,8 @@ class PassNode extends TempNode {
 		this._width = width;
 		this._height = height;
 
-		const effectiveWidth = this._width * this._pixelRatio * this._resolutionScale;
-		const effectiveHeight = this._height * this._pixelRatio * this._resolutionScale;
+		const effectiveWidth = Math.floor( this._width * this._pixelRatio * this._resolutionScale );
+		const effectiveHeight = Math.floor( this._height * this._pixelRatio * this._resolutionScale );
 
 		this.renderTarget.setSize( effectiveWidth, effectiveHeight );
 

+ 2 - 2
src/nodes/utils/RTTNode.js

@@ -202,8 +202,8 @@ class RTTNode extends TextureNode {
 			const pixelRatio = renderer.getPixelRatio();
 			const size = renderer.getSize( _size );
 
-			const effectiveWidth = size.width * pixelRatio;
-			const effectiveHeight = size.height * pixelRatio;
+			const effectiveWidth = Math.floor( size.width * pixelRatio );
+			const effectiveHeight = Math.floor( size.height * pixelRatio );
 
 			if ( effectiveWidth !== this.renderTarget.width || effectiveHeight !== this.renderTarget.height ) {
 

粤ICP备19079148号