Explorar o código

fix postprocessing ratio

sunag %!s(int64=6) %!d(string=hai) anos
pai
achega
48dd3dd763
Modificáronse 1 ficheiros con 13 adicións e 1 borrados
  1. 13 1
      examples/jsm/nodes/postprocessing/NodePostProcessing.js

+ 13 - 1
examples/jsm/nodes/postprocessing/NodePostProcessing.js

@@ -85,9 +85,21 @@ NodePostProcessing.prototype = {
 
 	},
 
+	setPixelRatio: function ( value ) {
+
+		this.renderer.setPixelRatio( value );
+
+		var size = this.renderer.getSize( new Vector2() );
+
+		this.setSize( size.width, size.height );
+
+	},
+
 	setSize: function ( width, height ) {
 
-		this.renderTarget.setSize( width, height );
+		var pixelRatio = this.renderer.getPixelRatio();
+
+		this.renderTarget.setSize( width * pixelRatio, height * pixelRatio );
 
 		this.renderer.setSize( width, height );