Use scene.pick to get per-point properties
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
Per-point properties (intensity, etc) can be used for styling but cannot be fetched back. A use case is being able to pick a point on the screen and get its properties.
One approach I could see here:
1. Render each point's index in the pick pass.
2. Use that index to fetch the value in the property's vertex buffer.
For (1) we would need to add a per-point ID vertex attribute. In WebGL 2 we can instead use `gl_VertexID`. This might be a special case for the pick pass because we don't want to create a pick id for every point. We'd also need to think about how this relates to `Cesium3DTileFeature`.
To speed up (2) we could keep vertex buffers resident on the CPU instead of offloading to the GPU like we do now. Maybe it would be on demand since we wouldn't want to do that by default.
Forum post: https://groups.google.com/forum/#!msg/cesium-dev/hjSPlQZjdc4/jKUdE9nDCAAJ
Contributor guide
Research direction
Start by tracing scene.pick and the pick pass, then review how per-point properties are stored in the property's vertex buffer. The issue proposes rendering a point index and fetching the corresponding value, while also raising CPU-resident buffers, WebGL 2 gl_VertexID, and Cesium3DTileFeature interactions. Done would mean picking a point returns its per-point properties without imposing unnecessary default memory costs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100