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

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

Closed
ptrgags opened this issue Nov 19, 2021 · 5 comments
Closed

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

ptrgags opened this issue Nov 19, 2021 · 5 comments

Comments

@ptrgags
Copy link
Contributor

ptrgags commented Nov 19, 2021

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
Copy link
Contributor

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:

  • Batch table binary properties can be transcoded to feature metadata directly. Binary types need to be mapped to feature metadata types and a schema needs to be generated (like in parseBatchTable.js).
  • JSON property arrays that are all the same type can be converted to binary. This applies to number, strings, and arrays of numbers and strings. Requires some special handling for fixed-size arrays vs. variable-size arrays.
  • JSON property arrays with mixed types would need to convert everything to a common type (e.g. an array of numbers and strings would convert everything to strings). Gets messier when JSON objects are involved.
  • JSON property arrays with null values can be converted to noData values.
  • Batch table hierarchy properties may need to be unpacked to parallel arrays and handle null values like above. Or add class hierarchy support to 3D Tiles Next Hierarchal Batch Table in 3D Tiles Next? #558.

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 CesiumGS/cesium-native#71 and CesiumGS/cesium-native#407 for notes. Later we'll need to do the same thing for the 3D Tiles to 3D Tiles Next pipeline.

@lilleyse
Copy link
Contributor

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

@nithinp7
Copy link

@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
Copy link
Contributor

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
Copy link
Contributor

javagl commented Jun 12, 2023

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 CesiumGS/3d-tiles-tools#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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants