CesiumGS / 3d-tiles

Specification for streaming massive heterogeneous 3D geospatial datasets :earth_americas:
2.12k stars 467 forks source link

Create a tool for converting 3D Tiles 1.0 to 3D Tiles Next #592

Closed ptrgags closed 1 year ago

ptrgags commented 2 years ago

It would be helpful to the community to have a tool to convert 3D Tiles 1.0 to 3D Tiles Next.

One key detail is to convert the 1.0 tile formats (b3dm, i3dm, pnts) to glTF, and add the 3DTILES_content_gltf extension as necessary.

Some links to similar tools for inspiration:

lilleyse commented 2 years ago

There are a few capabilities of the older Batch Table that do not have a direct counterpart in EXT_mesh_features:

Here are my initial thoughts on converting batch tables to feature metadata:

JSON -> binary transcoding would fall under a slow path that requires type checking, type conversion (if applicable), and allocating new buffers.

CesiumJS avoids the transcoding problem by having three different ways of storing metadata: MetadataTable.js for typed binary properties, JsonMetadataTable.js for JSON properties, and BatchTableHierarchy.js for 3DTILES_batch_table_hierarchy. These are all abstracted away in FeatureTable.js. A different system manages property textures.

Cesium Native transcodes b3dm content to glTF + EXT_feature_metadata at runtime. See https://github.com/CesiumGS/cesium-native/issues/71 and https://github.com/CesiumGS/cesium-native/issues/407 for notes. Later we'll need to do the same thing for the 3D Tiles to 3D Tiles Next pipeline.

lilleyse commented 2 years ago

Also consider having an upgrade path from the older EXT_feature_metadata to EXT_mesh_features.

nithinp7 commented 2 years ago

@kring and I talked yesterday about a tool to convert glTFs with regular png/jpg images into KTX2 as well. It would be very useful to fully benchmark the performance improvements for using KTX2. This might be easier for some glTFs over others, for instance glTFs with data uris or external images would be much easier to convert than images embedded in a buffer. So maybe a one-off tool or an addition to CDB-to-3D-Tiles-Next is a better option for testing purposes.

donmccurdy commented 2 years ago

a tool to convert glTFs with regular png/jpg images into KTX2 as well...

If you're looking for a general-purpose glTF → glTF+KTX2 converter, then Gestaltor (desktop), gltfpack (cli), or glTF-Transform (cli + JS library) can do this. These should all support data URIs, external images, etc.

javagl commented 1 year ago

I think that this issue can be closed, because it is not referring to the specification, but to tooling, and the exact use case of upgrading from 1.0 to 1.1 is part of https://github.com/CesiumGS/3d-tiles-tools/issues/5 . (Yes, this issue is 5 years old, but it has been "revived" recently...). Some of the points mentioned here are worth another review in the context of that other issue, but many details about upgrade functionalities are currently in the process of being sorted out there...