Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutlinePass doesn't work with pixel ratio 2 #11205

Closed
3 of 13 tasks
jack-jun opened this issue Apr 21, 2017 · 3 comments
Closed
3 of 13 tasks

OutlinePass doesn't work with pixel ratio 2 #11205

jack-jun opened this issue Apr 21, 2017 · 3 comments
Labels

Comments

@jack-jun
Copy link

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:
image

Three.js version
  • Dev
  • r84
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)
@mrdoob
Copy link
Owner

mrdoob commented Apr 21, 2017

/ping @spidersharma03

@Mugen87 Mugen87 added the Bug label Apr 23, 2017
@spidersharma03
Copy link
Contributor

I will take a look

@proteamer
Copy link
Contributor

proteamer commented May 4, 2017

It looks like EffectComposer doesn't handle pixelRatio which set in WebGLRenderer when creates WebGLRenderTarget.

I suggest to use next workaround:

  1. Create custom set size handler for effectFXAA:
effectFXAA.setSize = function(width, height) {
    this.uniforms.resolution.value.set(1 / width, 1 / height);
};
  1. Call 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);

@jack-jun jack-jun closed this as completed May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants