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 for clipping and camera navigation issues below ellipsoid #9200

Merged
merged 6 commits into from Feb 3, 2022

Conversation

chris-cooper
Copy link
Contributor

@chris-cooper chris-cooper commented Oct 14, 2020

After re-looking at #9198 it seems to be related to DepthPlane usage in Scene. It seems the DepthPlane is used for the following purpose:

image
https://github.com/CesiumGS/cesium/blob/master/Source/Scene/Scene.js#L3243-L3245

I tried a quick workaround to offset down by an arbitrary amount. It seems to address the reported issue.

hack

Assuming this is a valid fix, how should it be implemented?

  • Simple magic number (as shown in b96d673) Perhaps it should be -11000m to cater for bathymetry?
  • Viewer constructor options argument that is passed Viewer=>Scene=>DepthPlane
  • Other

You should find the issues are improved or resolved running a local Cesium from this branch and the same sandcastle code from a local server:
local sandcastle link

@cesium-concierge
Copy link

Thanks for the pull request @chris-cooper!

  • ✔️ 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.

@OmarShehata
Copy link
Contributor

Thanks for opening a PR Chris! There was some discussion here about pushing the depth plane down or other techniques that may be relevant here: #7879

@chris-cooper
Copy link
Contributor Author

Thanks @OmarShehata . After looking at https://github.com/CesiumGS/cesium/pull/8398/files it looks like the default for frameState.minimumTerrainHeight could be set differently (e.g. an option argument for Scene) and then used by DepthBuffer. I've tweaked this PR as an example.

@cesium-concierge
Copy link

Thanks again for your contribution @chris-cooper!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

1 similar comment
@cesium-concierge
Copy link

Thanks again for your contribution @chris-cooper!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@cesium-concierge
Copy link

Thanks again for your contribution @chris-cooper!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@chris-cooper
Copy link
Contributor Author

What would you like to do with this PR @OmarShehata ?

@grantis
Copy link

grantis commented Feb 4, 2021

What would you like to do with this PR @OmarShehata ?

Is this PR waiting on anything, this PR would possibly fix an issue we are having.

@cesium-concierge
Copy link

Thanks again for your contribution @chris-cooper!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@grantis
Copy link

grantis commented Mar 15, 2021

@OmarShehata @chris-cooper Hey folks, is this PR going to be in the next release? This appears to relate to a issue our customers face in locations such as Florida Keys.

I've looked at the travis-ci and it looks like the tests are failing is that what is currently blocking the merge?

@dzungpng
Copy link
Contributor

We are looking into this PR and other possible ways to resolve the issue. The current estimate date is the May release. @grantis

@slchow
Copy link
Contributor

slchow commented Jun 11, 2021

We got another bump for this issue (and request for an updated ETA) from the forum: https://community.cesium.com/t/new-cesiumjs-release/11110/15

@katSchmid
Copy link

Any news on this? Thanks

@cesium-concierge
Copy link

Thanks again for your contribution @chris-cooper!

No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

1 similar comment
@cesium-concierge
Copy link

Thanks again for your contribution @chris-cooper!

No one has commented on this pull request in 90 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 90 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@ggetz
Copy link
Contributor

ggetz commented Jan 25, 2022

Hi @chris-cooper and all, we just talked through this PR with @lilleyse. This is definitely a problem we've run into ourselves. While this does technically address the issue, it's a bit of a band-aid fix. We agree that 1000 seems a bit arbitrary. Can we get a real world constant, keeping in mind that some users are not using earth as their ellipsoid?
Also it may be better for this constant to live on the depth plane.

Also generally for bathymetry we disable the depth plan entirely.

@lilleyse
Copy link
Contributor

Also generally for bathymetry we disable the depth plan entirely.

Slight correction - we disable the depth plan when the camera is underground or the globe is translucent, but not necessarily for bathymetry.

@chris-cooper
Copy link
Contributor Author

Thanks @ggetz and @lilleyse . I've updated this PR to the latest master + tried to address your comment @ggetz . Is this what you meant?

local sandcastle example

@ggetz
Copy link
Contributor

ggetz commented Jan 31, 2022

Thanks for the update @chris-cooper! This approach looks better. Would you be able to add documentation and unit tests, and update CHANGES.md?

@ggetz ggetz assigned ggetz and unassigned sanjeetsuhag Jan 31, 2022
@chris-cooper
Copy link
Contributor Author

I've added some of those things @ggetz . For now it is just testing the option gets passed through. I might need some help from someone with knowledge of that area of the rendering code if we want to test it more rigorously.

@ggetz
Copy link
Contributor

ggetz commented Feb 2, 2022

Thanks @chris-cooper! I suppose to test this more rigorously, we could add a new test that confirms the depth plane draw command has boundingVolume set to the expected value. But no similar tests currently exist for DepthPlane. @lilleyse Any thoughts?

@lilleyse
Copy link
Contributor

lilleyse commented Feb 2, 2022

A test like that could be added SceneSpec.js

@chris-cooper
Copy link
Contributor Author

I've tried adding a spec for that thanks @ggetz @lilleyse .

@ggetz
Copy link
Contributor

ggetz commented Feb 3, 2022

Awesome! Thanks for your patience with this PR @chris-cooper !

@ggetz
Copy link
Contributor

ggetz commented Mar 7, 2022

Thanks for the report @v8gx. I opened #10166 to track. Would you possibly be able to contribute a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Issue/PR closed
Development

Successfully merging this pull request may close these issues.

None yet