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

convert I3dm metadata to EXT_structural_metadata and EXT_instance_features #1051

Merged
merged 13 commits into from
Jan 16, 2025

Conversation

timoore
Copy link
Contributor

@timoore timoore commented Jan 2, 2025

This mostly follows the lead of PntsToGltfConverter.cpp in converting the I3dm batch table to structural metadata and EXT_instance_features feature IDs. It does not handle the obscure case of an I3dm gltf model that already contains EXT_mesh_gpu_instancing instances. Tested with cesium-unreal and a tileset tiled from CZML.

Happy new year!

Copy link
Member

@kring kring left a comment

Choose a reason for hiding this comment

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

Thanks @timoore, this looks great! Just a few small comments below.

CHANGES.md Outdated Show resolved Hide resolved
Cesium3DTilesContent/src/I3dmToGltfConverter.cpp Outdated Show resolved Hide resolved
Cesium3DTilesContent/src/I3dmToGltfConverter.cpp Outdated Show resolved Hide resolved
Cesium3DTilesContent/src/I3dmToGltfConverter.cpp Outdated Show resolved Hide resolved
numInstances,
type);
gltf.accessors[static_cast<uint32_t>(accessorId)].byteOffset =
static_cast<int64_t>(bufferOffset);
Copy link
Member

Choose a reason for hiding this comment

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

Is this cast needed? It should be a widening conversion.
Also, for the one above, it's fine to use size_t(accessorId) rather than the more verbose static cast when you know the accessorId can't be negative. If you're not sure of that, add a runtime check rather than a static_cast. If it can only be negative as a result of a developer error, add a CESIUM_ASSERT(accessorId >= 0);.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I was getting a warning about unsigned to signed conversion, but I will check that.

Cesium3DTilesContent/src/I3dmToGltfConverter.cpp Outdated Show resolved Hide resolved
@kring
Copy link
Member

kring commented Jan 16, 2025

Thanks @timoore!

@kring kring merged commit 6dcf071 into main Jan 16, 2025
22 checks passed
@kring kring deleted the i3dm-metadata branch January 16, 2025 22:41
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.

2 participants