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

Decouple SSE from Resolution & Resolution Scales With Device Pixel Ratio #8082

Closed
ProjectBarks opened this issue Aug 16, 2019 · 2 comments
Closed

Comments

@ProjectBarks
Copy link
Contributor

When working to have Cesium render at the browsers native resolution (#7875) density it became apparent that there was a bigger design change required. Here are some the changes I plan to bring in a pull request soon (since they are highly related)

Decouple SSE from Cesium's Resolutions

Problem

Currently, if the user sets the resolution scale to x2 the SSE will be effected as well. It is outside a users expectation for a change in resolution to also impact SSE. Here is an example:

resolutionScale used to be a constant 1 that could be changed by the user but now it's set to window.devicePixelRatio by default.

resolutionScale = 1 resolutionScale = 2 resolutionScale = 2

maximumScreenSpaceError * viewer.resolutionScale
image image image

When the user sets the resolutionScale to 2 it nearly triples the amount of tiles loaded. The only thing resolutionScale should do is increase resolution instead of inadvertently impacting SSE.

Solution

The way to fix this is take the resolutions scaling factor and multiply SSE by that factor. When resolution changes SSE stays constant. (Much like the example I provided in the third quadrant of the table) This would involve passing a resolutionScale to FrameState and making resolutionScale a part of the Scene.

Resolution Scales With Device Pixel Ratio

Cesium should render at the same pixel ratio as the window.devicePixelRatio but as Ed pointed out:

But this isn't resolutionScale, it's devicePixelRatio. The latter is affected by things such as CTRL + and CTRL - screen scaling, and Windows Desktop DPI scaling. Just for completeness, has someone tested the effects of those being set to non-default settings?

Me an @lilleyse agreed when talking privately most users would prefer to see an equally high resolution image of cesium when zooming in than degraded image. So instead of passing devixePixelRatio as the default resolution scale we create a resolution final resolution scale that is: resolutionScale * devicePixelRatio.

Please feel free to provide feedback.

@lilleyse
Copy link
Contributor

@ProjectBarks generally sounds good. I'm curious to set what the final code will look like.

@lilleyse
Copy link
Contributor

Fixed in #8083

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

No branches or pull requests

2 participants