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

WebGLDeferredRenderer is broken on retina display #5815

Closed
brianchirls opened this issue Dec 25, 2014 · 6 comments
Closed

WebGLDeferredRenderer is broken on retina display #5815

brianchirls opened this issue Dec 25, 2014 · 6 comments

Comments

@brianchirls
Copy link
Contributor

See attached screenshot of the deferred point lights example. This is on a late 2013, 15-inch Retina MacBook Pro, with NVIDIA GeForce GT 750M 2048 MB. It looks the same in both Firefox and Chrome. Runs fine on my office machine, which does not have a retina display. Both of the other deferred renderer examples have similar results.
deferred_lighting_bug

@brianchirls
Copy link
Contributor Author

The major problem is here:
https://github.com/mrdoob/three.js/blob/master/examples/webgldeferred_pointlights.html#L354

HEIGHT = window.innerHeight - 2 * MARGIN;

Once MARGIN is defined, the scene works but we still have the usual 1/4 screen retina display bug.

@brianchirls
Copy link
Contributor Author

WebGLDeferredRenderer multiplies the canvas dimensions by devicePixelRatio, and then it passes those dimensions on to WebGLRenderer which multiplies it again. So the canvas is much bigger than it should be.

@mrdoob
Copy link
Owner

mrdoob commented Dec 29, 2014

The devicePixelRatio logic has been changed a bit. Could you try the version in https://github.com/mrdoob/three.js/archive/dev.zip?

@brianchirls
Copy link
Contributor Author

I didn't see those new commits. Yeah, that does it. Thanks!

@brianchirls
Copy link
Contributor Author

Actually, there is still the issue with the undeclared MARGIN variable, though it has nothing to do with retina display.

mrdoob added a commit that referenced this issue Dec 31, 2014
@mrdoob
Copy link
Owner

mrdoob commented Dec 31, 2014

Fixed! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants