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

Fix double globe when lighting is enabled #8348

Closed
wants to merge 1 commit into from

Conversation

OmarShehata
Copy link
Contributor

@OmarShehata OmarShehata commented Nov 2, 2019

In CesiumJS 1.63, try running:

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.scene.globe.enableLighting = true

You'll get a double globe:

image

You can fix this by going back to the old resolution scale behavior we had in 1.61:

viewer.resolutionScale = 1.0 / window.devicePixelRatio;

This happens because in #8318 we added a multiplication by czm_pixelRatio in metersPerPixel.glsl. This caused a second globe to render at half the size when globe lighting was enabled. This fixes it by dividing back by that value. But I'm not sure if this is the right fix. @lilleyse @IanLilleyT what do you think?

@mramato is this worth a 1.63.1 patch release?

This was reported on the forum.

In #8318 we added a multiplication by czm_pixelRatio in metersPerPixel.glsl. This caused a second globe to render at half the size when globe lighting was enabled. This fixes it by dividing back by that value.
@cesium-concierge
Copy link

Thanks for the pull request @OmarShehata!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@mramato
Copy link
Contributor

mramato commented Nov 2, 2019

@mramato is this worth a 1.63.1 patch release?

The bar for a patch release is usually pretty high, since this only happens with lighting enabled, only on machines that have devicePixelRatio !== 1, and has an easy workaround, I don't think doing a release is warranted unless we find out it affects a large piece of the community.

I would love to move to more frequent CesiumJS releases in general, but that's a larger conversation.

@IanLilleyT
Copy link
Contributor

@OmarShehata I have a related fix that also affects labels. So once that's up we can merge mine and close this one.

@IanLilleyT
Copy link
Contributor

Here's the PR that fixes the globe lighting and labels: #8351

@lilleyse
Copy link
Contributor

lilleyse commented Nov 5, 2019

Superseded by #8351

@lilleyse lilleyse closed this Nov 5, 2019
@lilleyse lilleyse deleted the fix-double-globe branch November 5, 2019 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants