浏览代码

Merge pull request #16393 from Mugen87/dev29

Examples: Fixed pixel ratio computation in some post-processing examples.
Michael Herzog 6 年之前
父节点
当前提交
0cc10e97fa

+ 2 - 2
examples/webgl_postprocessing_backgrounds.html

@@ -241,8 +241,8 @@
 				renderer.setSize( width, height );
 				renderer.setSize( width, height );
 
 
 				var pixelRatio = renderer.getPixelRatio();
 				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 );
 				composer.setSize( newWidth, newHeight );
 
 
 			}
 			}

+ 2 - 2
examples/webgl_postprocessing_ssaa.html

@@ -145,8 +145,8 @@
 				renderer.setSize( width, height );
 				renderer.setSize( width, height );
 
 
 				var pixelRatio = renderer.getPixelRatio();
 				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 );
 				composer.setSize( newWidth, newHeight );
 
 
 			}
 			}

+ 2 - 2
examples/webgl_postprocessing_ssaa_unbiased.html

@@ -206,8 +206,8 @@
 				renderer.setSize( width, height );
 				renderer.setSize( width, height );
 
 
 				var pixelRatio = renderer.getPixelRatio();
 				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 );
 				composer.setSize( newWidth, newHeight );
 
 
 			}
 			}

+ 2 - 2
examples/webgl_postprocessing_taa.html

@@ -174,8 +174,8 @@
 				renderer.setSize( width, height );
 				renderer.setSize( width, height );
 
 
 				var pixelRatio = renderer.getPixelRatio();
 				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 );
 				composer.setSize( newWidth, newHeight );
 
 
 			}
 			}