소스 검색

fix postprocessing ratio

sunag 5 년 전
부모
커밋
48dd3dd763
1개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  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 );