Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix incorrect zoomFactor. #3251

Closed
wants to merge 1 commit into from
Closed

Fix incorrect zoomFactor. #3251

wants to merge 1 commit into from

Conversation

mramato
Copy link
Contributor

@mramato mramato commented Nov 28, 2015

As @kring pointed out in #3249, my code in #3233 was actually wrong and caused increased resolution loss when window.devicePixelRatio was greater than 1. We should just be ignoring window.devicePixelRatio completely because the browser takes care of it by default.

@pjcozzi can you give this branch a try. It was rendering at quarter resolution on your machine, since you have a devicePixelRatio of 2. Now it will render at half but that should look much better.

As @kring pointed out in #3249, my code in #3233 was actually wrong and
caused increased resolution loss when `window.devicePixelRatio` was greater
than 1.  We should just be ignoring `window.devicePixelRatio` completely
because the browser takes care of it by default.
@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 28, 2015

Still looks bad:

image

Is it possible to enable this on mobile only (assuming it looks good there). Or just go back to the old default and cover this in the upcoming performance tutorial?

@mramato
Copy link
Contributor Author

mramato commented Nov 28, 2015

I think we may be back to my original assertion that resizing the canvas is causing blurring. I started a WebGL dev-list discussion to see if anything has any recommendations: https://groups.google.com/d/msg/webgl-dev-list/Re_fVhnJ5R0/eRyji2xcCgAJ

Is it possible to enable this on mobile only (assuming it looks good there). Or just go back to the old default and cover this in the upcoming performance tutorial?

I would recommend against this and would rather solve the problem for real. Larger tablets may still show blurring, and as I mentioned in #3249, I doubt 3K or 4K laptops with Intel cards can run Cesium very well with the current behavior.

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 30, 2015

What's the plan for Cesium 1.16? Back out #3233 and revisit?

@mramato
Copy link
Contributor Author

mramato commented Nov 30, 2015

What's the plan for Cesium 1.16? Back out #3233 and revisit?

Unfortunately, yes. I'm 99% sure the only remaining issue is that browsers perform a smooth scale when resizing a WebGL canvas and there seems to be no way to disable that. My only idea would be to blit to a 2D canvas with imageSmoothingEnabled set to false, but that involved jumping through a bunch of hoops. Hopefully someone will chime in on my webgl-dev post with some ideas. If not, I'll try pinging some contacts directly. I have to imagine this is an issue for lots of engines that want good cross-device performance.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants