In the outline pass example, the pixel ratio is set to 1.
https://github.com/mrdoob/three.js/blob/master/examples/webgl_postprocessing_outline.html#L161
The scene is fuzzy and if we comment the line and use the device's pixel ratio, the scene is squeezed to the left bottom corner as the following screenshot:
/ping @spidersharma03
I will take a look
It looks like EffectComposer doesn't handle pixelRatio
which set in WebGLRenderer
when creates WebGLRenderTarget.
I suggest to use next workaround:
effectFXAA
: effectFXAA.setSize = function(width, height) {
this.uniforms.resolution.value.set(1 / width, 1 / height);
};
composer.setSize
with premultiplied width
and height
during initialization and window resizing:var size = renderer.getSize();
var pixelRatio = renderer.getPixelRatio();
composer.setSize(width * pixelRatio, height * pixelRatio);
Most helpful comment
It looks like EffectComposer doesn't handle
pixelRatio
which set inWebGLRenderer
when creates WebGLRenderTarget.I suggest to use next workaround:
effectFXAA
:composer.setSize
with premultipliedwidth
andheight
during initialization and window resizing: