CesiumGS / CesiumGS/cesium-native
Use Gltf extensions instead of extras for more custom behavior when processing mesh
- Dominant language
- C++
- Stars
- 623
- Forks
- 277
- PR merge metrics
- No merged PRs in 30d
Description
Currently we use extras to embed some metadata for mesh and material processing, for example, Skirt metadata, water mask, etc. The problem with extras is that it uses json value for type erasure and requires safety check (e.g. ensure property name is there and property type is double, etc) to ensure that it conforms to the custom properties. It will be a lot harder if extras has some nested json into it. Extensions on the other hand use `std::any` for type erasure and use `std::any_cast` for type safety, so it requires less check and maybe a little bit faster. Nested object is also handled more elegantly. Beside embedding a custom metadata using type is a lot more self-documented than using json.
Contributor guide
Assessment
This issue has not been assessed yet.