瀏覽代碼

Fix pixel ratio

Garrett Johnson 4 年之前
父節點
當前提交
cdab337b20
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      examples/webgl_postprocessing_ssaa.html

+ 1 - 2
examples/webgl_postprocessing_ssaa.html

@@ -80,10 +80,9 @@
 				const width = window.innerWidth || 1;
 				const width = window.innerWidth || 1;
 				const height = window.innerHeight || 1;
 				const height = window.innerHeight || 1;
 				const aspect = width / height;
 				const aspect = width / height;
-				const devicePixelRatio = window.devicePixelRatio || 1;
 
 
 				renderer = new THREE.WebGLRenderer();
 				renderer = new THREE.WebGLRenderer();
-				renderer.setPixelRatio( devicePixelRatio );
+				renderer.setPixelRatio( 1 ); // ensure pixel ratio is always 1 for performance reasons
 				renderer.setSize( width, height );
 				renderer.setSize( width, height );
 				document.body.appendChild( renderer.domElement );
 				document.body.appendChild( renderer.domElement );