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

Add clipping planes to ModelExperimental #10250

Merged
merged 6 commits into from
Apr 1, 2022

Conversation

j9liu
Copy link
Contributor

@j9liu j9liu commented Mar 30, 2022

Closes #10100.

This PR implements clipping planes in ModelExperimental, following how they are implemented in Model.js. Some sandcastles to test:

Unit tests were added accordingly -- I realized I forgot to add a ImageBasedLightingPipelineStageSpec in my IBL PR, so it's included in these changes.

EDIT: also fixes #8234

@cesium-concierge
Copy link

Thanks for the pull request @j9liu!

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

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.

@ptrgags
Copy link
Contributor

ptrgags commented Mar 31, 2022

@j9liu in regards to that tileset that's crashing, it's due to the BIM model being a glTF 1.0 asset which is not currently supported.

Try This modified Sandcastle -- everything else is running fine.

However, I notice one thing that seems off. If you choose the Point Cloud example, the clipping planes widget's translation seems to move much faster than the mouse. Does this have to do with bounding spheres being too large? or something else? (#10244)

@j9liu
Copy link
Contributor Author

j9liu commented Mar 31, 2022

@ptrgags it seems that the plane's translation is faster than the most whether ModelExperimental is used to load the Sandcastle or not. The original, unmodified Sandcastle demonstrates the same behavior

Copy link
Contributor

@ptrgags ptrgags left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j9liu had a few comments about the code, but the examples seem to be working correctly.

Comment on lines +212 to +217
const clippingPlanes = options.clippingPlanes;
if (defined(clippingPlanes) && clippingPlanes.owner === undefined) {
ClippingPlaneCollection.setOwner(clippingPlanes, this, "_clippingPlanes");
} else {
this._clippingPlanes = clippingPlanes;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j9liu, @lilleyse and I have been discussing this offline, not sure the best way we want to handle this. It would be nice to make clipping planes shareable, but that might require putting more responsibility on the user since it's hard to tell when to destroy the GPU resources.

See also #6599 (comment).

Not sure if this discussion has to hold up this PR (any changes could come later). just wanted to write it down somewhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided that it would be better to handle this with some sort of reference count mechanism. I'll write up the discussion in a separate issue and link it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yesterday afternoon I opened #10257 for this.

Source/Scene/ModelExperimental/ModelExperimental.js Outdated Show resolved Hide resolved
@j9liu
Copy link
Contributor Author

j9liu commented Mar 31, 2022

@ptrgags updated! I also pushed a change to fix #8234.

@ptrgags
Copy link
Contributor

ptrgags commented Apr 1, 2022

@j9liu everything looks good, and #10257 will be a separate PR so it doesn't need to hold this one up.

The Mount St. Helens example looks a lot better now!, it's easier to see the difference:

Without clipping Planes With Clipping Planes
image image

I checked that the Model sandcastles are working correctly with these changes and that the ModelExperimental versions are working properly aside from known issues (we also noticed #10255 along the way).

Thanks @j9liu, I'm merging!

@ptrgags ptrgags merged commit 6bd7a3b into main Apr 1, 2022
@ptrgags ptrgags deleted the model-experimental-clipping-planes branch April 1, 2022 12:50
IanLilleyT pushed a commit that referenced this pull request Apr 1, 2022
…lanes

Add clipping planes to `ModelExperimental`
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

Successfully merging this pull request may close these issues.

Clipping planes in ModelExperimental Terrain Clipping Planes Demo confusing for St. Helens
3 participants