Robust Clipping Polygon v2 (terrain and 3D tileset)
Robust Clipping Polygon v2 (terrain and 3D tileset)
Summary
We need the capability to topologically clip terrain and 3D tiles based on complex polygons with production-ready performance and precision. While a clipping solution already exists in CesiumJS, it has critical limitations that prevent production deployment.
Current Issues
The existing clipping polygon implementation suffers from three major problems:
1. Precision Issues
- Clipping accuracy errors of several meters between the input polygon and actual geometry clipping
- Topological precision loss affecting project integration workflows
2. Performance Degradation
- Geometry is not cached, causing severe performance drops
- Clipping calculations performed every frame instead of being optimized
- Frame rate becomes unusable with complex polygons or large datasets
3. Shadow Rendering Problems
- Shadow engine continues to cast shadows from hidden/clipped geometry
- Makes shadow studies impossible for integrated projects who replace a part of 3d tileset
Business Impact
This is currently the n°1 feature request from our hundreds of production users. The ability to client-side integrate custom projects and cleanly clip portions of tilesets without performance loss is essential for shadow studies and project visualization.
This functionality is core not just for our use case, but for the entire AEC (Architecture, Engineering, Construction) ecosystem that needs to integrate future projects into existing base datasets.
Use Cases
- Urban Planning: Integrate new building designs into existing city models
- Construction: Visualize project phases by clipping existing terrain/buildings
- Shadow Analysis: Perform accurate shadow studies on integrated projects
- Environmental Impact: Assess how new developments affect existing landscapes
- Real Estate: Show proposed developments in context of existing infrastructure
Expected Solution
We need a robust clipping system that provides:
- Higher Precision: Sub-decimeter accuracy between input polygons and actual clipping
- Performance Optimization: Cached geometry processing with minimal frame impact
- Shadow Integration: Proper shadow casting that respects clipped geometry
- Complex Polygon Support: Handle concave polygons, holes, and multi-part geometries
- Scalability: Handle large tilesets and terrains without performance degradation
Technical Requirements
- Maintain existing clipping polygon API compatibility where possible
- Implement geometry caching to avoid per-frame recalculation
- Update shadow rendering pipeline to respect clipped areas
- Support both terrain and 3D tileset clipping simultaneously
Community Impact
This enhancement would benefit the entire CesiumJS community, particularly:
- AEC professionals integrating design projects
- Urban planners visualizing development scenarios
- Researchers performing spatial analysis
- Any application requiring precise geometric clipping
Contribution Offer
We are prepared to contribute financially to ensure this feature benefits the entire community and would be happy to allocate necessary resources to make this key functionality a reality. Feel free to reach out if you're interested in collaborating on additional enhancements or related features beyond this core clipping functionality.
Labels
enhancement performance 3d-tiles terrain clipping shadows high-priority
I added a PR to address the performance issue, at https://github.com/CesiumGS/cesium/pull/12650 . It's a quick shot, based on my investigations in that issue. Maybe it's at least a reasonable step to alleviate the performance issues.
Thanks for all the use case info that's included in this writeup @tbenazzi! Very useful.
I want to make sure each of the requests here are documented in an actionable issue, and that relevant details are tracked in each one. My intent is to close this issue in favor of the individual items, and any business discussions will be handled over email with our BD team.
I've updated the following issues. To ensure they are linked back to this discussion. Please let me know if I've missed anything or mischaracterized your feedback.
- https://github.com/CesiumGS/cesium/issues/12321
- https://github.com/CesiumGS/cesium/issues/12258
- https://github.com/CesiumGS/cesium/issues/6261