styling for models with 3DTILES_metadata but no EXT_mesh_features
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
This is closely related to #10015 and #9884 but this has a few details that don't fully fit in either issue.
Suppose you have a tileset with 3DTILES_metadata, 3DTILES_content_gltf, but the glTF files do not use `EXT_mesh_features`.
Right now, no property tables will be created, so `getFeature()` would return undefined. When used in styling, any feature properties will result in `undefined` values which can cause problems like in this [this local sandcastle](https://sandcastle.cesium.com/#c=dVLBbtQwEP2VkYW0WWlrg4qEmiYrpOUI4tAKDpiDNx6IwbFX9iRLW+2/YztZKFBOM555b+a9SSYVYDJ4xAAtODzCDqMZB/6h1CrJuvLeeUfKOAySra+lk25KvEh3Fv+kzeHyza2xeJPb1YN0AJ23PtRQ8vxy2pDxLtbwaS5BStizBzVS78MJ2raF1TxrJdkGkow8oVoF1Ku1ZJ83v2gURnwE2NsRC2IGlHAq6Nj7Yw15CyVxOz86OsEWnksm3em3qdyMSMnWfBYeO3TID8EMSfOEkSutqzzwP7YTuVqMjsHmjT3RoRbC+k7Z3keqX169uhKX+qLsuohqOKQoHP4gsUz4aKhf0ndISitSYlHGv0Xv0lGKs7V0Wfq5df4iJc6WZhP33g+3vlpw62u2YU0Bbc+HfG2Ggw+UNVecC8IkSlGStR+772l0F2PelKGNeExttJnA6PaJXwU6q2JMnS+jtTfmHiXbNiLh/6Far7RxX99PGKy6y7D+xfbtXOScNyI9n2aS93avwl+TfwI) (requires data from https://github.com/CesiumGS/3d-tiles-samples).
Not entirely sure if this is the right fix, but I think this requires:
1. Even if there are no feature tables, an empty one should be created. Not sure if this should be a `ModelFeatureTable` with length 0, or perhaps create a new class `EmptyFeatureTable`. This idea of "empty" feature tables seems similar to #9884, except instead of representing an arbitrary number of features without metadata, this is a table that represents no features. It would be good to consider both at once.
2. We might want to consider a new type of `XxxFeature` that represents the whole model, and has a `getProperty()` that will look for tileset metadata (essentially #10015).
Contributor guide
Research direction
Start by reproducing the linked local Sandcastle with the 3d-tiles-samples data and inspect how getFeature() behaves when 3DTILES_metadata is present without EXT_mesh_features. Read related issues #10015 and #9884, then evaluate the ModelFeatureTable, possible EmptyFeatureTable, and whole-model feature approaches described here. Done means styling no longer receives unexpected undefined property values and the chosen behavior is covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100