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

Support voxel tilesets containing glTF tiles using the EXT_primitive_voxels extension #12432

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

jjhembd
Copy link
Contributor

@jjhembd jjhembd commented Jan 11, 2025

Description

This PR updates VoxelPrimitive and related classes to support tilesets using the proposed update to EXT_primitive_voxels.

Along the way, the internal APIs were cleaned up and made more consistent with Cesium3DTileset, to prepare for work on #12297.

Key code changes include:

  • The VoxelProvider interface always returns a VoxelContent, rather than an array of metadata. This affects not just Cesium3DTilesVoxelProvider, but procedural data as well--see the Sandcastles for an example.
  • VoxelContent can now be constructed before the data is ready, via the asynchronous VoxelContent.fromGltf method, and updated updated via VoxelContent.prototype.update. This makes it more similar to Cesium3DTileContent. For synchronous construction (e.g. with procedural data), use VoxelContent.fromMetadataArray.
  • VoxelTraversal was refactored to use smaller functions that are structured more like Cesium3DTilesetTraversal. For example, loadAndUnload was broken into selectKeyframeNodes (similar to Cesium3DTilesetTraversal.selectTiles) and updateTiles. The updateTiles loop is where we call VoxelContent.update to process glTFs.

Test datasets were also updated to the new format. Note that the tilesets in Apps/SampleData/Cesium3DTiles/Voxel/ are a copy of Specs/Data/Cesium3DTiles/Voxel.

Issue number and link

Resolves #12368.

Related: #12297

Testing plan

Load the three Voxel-related Sandcastles and verify all datasets load and functionalities are unchanged.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

Thank you for the pull request, @jjhembd!

✅ We can confirm we have a CLA on file for you.

@jjhembd jjhembd marked this pull request as ready for review January 23, 2025 17:02
@j9liu
Copy link
Contributor

j9liu commented Jan 23, 2025

@jjhembd do you mind also accounting for CesiumGS/3d-tiles#780? (still working on test data, but I'll get it to you ASAP)

@jjhembd jjhembd mentioned this pull request Jan 27, 2025
11 tasks
Copy link
Contributor

@ggetz ggetz left a comment

Choose a reason for hiding this comment

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

Thanks @jjhembd!

Tests and examples are working well! I had a few comments around the API, but otherwise the code is looking good too.

Let me know once you get a chance to address those and @j9liu's comments.

Apps/Sandcastle/gallery/Voxels in 3D Tiles.html Outdated Show resolved Hide resolved
Apps/Sandcastle/gallery/Voxels in 3D Tiles.html Outdated Show resolved Hide resolved
packages/engine/Source/Scene/VoxelContent.js Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
packages/engine/Source/Scene/VoxelProvider.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/VoxelProvider.js Outdated Show resolved Hide resolved
@jjhembd
Copy link
Contributor Author

jjhembd commented Jan 31, 2025

Thanks for the feedback @j9liu and @ggetz! I think I addressed everything.

@ggetz
Copy link
Contributor

ggetz commented Jan 31, 2025

Thanks @jjhembd! Could you please merge in main?

Copy link
Contributor

@ggetz ggetz left a comment

Choose a reason for hiding this comment

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

This is looking great @jjhembd! Just a few (hopefully) small comments, and then this should be good to go.

@jjhembd
Copy link
Contributor Author

jjhembd commented Feb 1, 2025

Thanks @ggetz, I think I incorporated all those comments. This should be ready for another look.

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.

Support for newer EXT_primitive_voxels in CesiumJS
3 participants