CesiumGS / CesiumGS/cesium-native
Add support for height queries against instanced models
- Dominant language
- C++
- Stars
- 623
- Forks
- 277
- PR merge metrics
- No merged PRs in 30d
Description
#783 adds support for querying heights from a tileset at a point. However, it reports a warning - and doesn't find intersections - when the position falls within a tile that uses `EXT_mesh_gpu_instancing`.
Implementing support for height queries against instanced models on CPU will not be very efficient. We'd probably have to compute a bounding box for each instance, test the ray against that, and then for each hit, test the ray against the instantiated triangles. A GPU solution is going to be much more performant, but that raises lots of new challenges in the platform-agnostic environment of cesium-native.
A hybrid solution might be viable. cesium-native finds and loads the tiles that need to be tested against the height query ray, but then hands it off to the "renderer" (i.e., Unreal, Unity, etc.) via some interface to determine the actual intersection point. Within game engines, we could implement this via rendering and reading the depth buffer (as CesiumJS does), or we could use the game engines' physics engines.
Contributor guide
Research direction
Start by reviewing the height-query work from #783 and the current handling of tiles using EXT_mesh_gpu_instancing. Then examine how cesium-native could communicate intersection work to renderer integrations such as Unreal or Unity. Done should include height queries that find intersections in instanced models without the current warning, with the chosen approach documented and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100