Parcourir la source

modified webgl_postprocessing_smaa.html to correct a bug with displays with DPR > 1

Roberto Ranon il y a 7 ans
Parent
commit
1a7ca40e98
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      examples/webgl_postprocessing_smaa.html

+ 3 - 3
examples/webgl_postprocessing_smaa.html

@@ -76,7 +76,7 @@
 				composer = new THREE.EffectComposer( renderer );
 				composer.addPass( new THREE.RenderPass( scene, camera ) );
 
-				pass = new THREE.SMAAPass( window.innerWidth, window.innerHeight );
+				pass = new THREE.SMAAPass( window.innerWidth * renderer.getPixelRatio(), window.innerHeight * renderer.getPixelRatio() );
 				pass.renderToScreen = true;
 				composer.addPass( pass );
 
@@ -95,8 +95,8 @@
 				renderer.setSize( width, height );
 
 				var pixelRatio = renderer.getPixelRatio();
-				var newWidth  = Math.floor( width / pixelRatio ) || 1;
-				var newHeight = Math.floor( height / pixelRatio ) || 1;
+				var newWidth  = Math.floor( width * pixelRatio ) || 1;
+				var newHeight = Math.floor( height * pixelRatio ) || 1;
 				composer.setSize( newWidth, newHeight );
 
 			}