Explorar el Código

Merge pull request #18326 from elalish/banding

Fix PMREM banding on Pixel
Michael Herzog hace 5 años
padre
commit
98a4a7eac0
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      src/extras/PMREMGenerator.js

+ 4 - 4
src/extras/PMREMGenerator.js

@@ -434,10 +434,10 @@ function _createRenderTarget( params ) {
 function _setViewport( x, y, width, height ) {
 
 	var invDpr = 1.0 / _renderer.getPixelRatio();
-	x *= invDpr;
-	y *= invDpr;
-	width *= invDpr;
-	height *= invDpr;
+	x = ( x + 0.5 ) * invDpr;
+	y = ( y + 0.5 ) * invDpr;
+	width = ( width + 0.5 ) * invDpr;
+	height = ( height + 0.5 ) * invDpr;
 	_renderer.setViewport( x, y, width, height );
 	_renderer.setScissor( x, y, width, height );