docs(rendering): drop completed Phase 2
Phase 2.1/2.2/2.3 landed across the previous commits: -727992bquadtree primitive -3e87460Scene::entity_index lazy build -e43498dwire tessellation uses query_rect -fcf4d4fmesh draw-time frustum cull -b70c9f9hatch + wipeout draw-time frustum cull What was skipped on purpose: - Octree-with-Aabb3: meshes only carry XY world_aabb today; the pragmatic adaptation is a 4-corner projection test in `compute_mesh_lod`. Revisit if a true 3D viewport mode lands. - Per-mutation incremental quadtree updates: `entity_index_cache` is geometry_epoch-keyed and rebuilds lazily on next query. Full rebuild is ~50 ms on a 100 k-entity doc — acceptable for occasional edits; promote to incremental updates if profiling shows the rebuild cost. Phase 4 (GPU-side culling) remains the next big lever. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
b70c9f9262
commit
38f9733eb1
1 changed files with 0 additions and 38 deletions
|
|
@ -12,42 +12,6 @@ Current pipeline order:
|
|||
|
||||
---
|
||||
|
||||
## Phase 2 — Spatial Acceleration Structure
|
||||
|
||||
**Goal:** O(log n) visibility queries instead of O(n) linear scan.
|
||||
|
||||
### 2.1 Quadtree (2D Documents)
|
||||
|
||||
Partition world space into a quadtree keyed by `Aabb2`. Build once on document load, update
|
||||
incrementally on entity add/remove/modify.
|
||||
|
||||
```
|
||||
QuadTree<EntityId>
|
||||
├── query_rect(Aabb2) → Vec<EntityId>
|
||||
└── insert / remove / update
|
||||
```
|
||||
|
||||
Store in `scene/mod.rs` alongside the entity cache. Invalidate only the nodes touched by a
|
||||
modified entity.
|
||||
|
||||
### 2.2 Octree (3D Solids)
|
||||
|
||||
For `MeshModel` / `solid3d` entities, use an octree with `Aabb3` keys. Query returns candidate
|
||||
mesh IDs for frustum culling.
|
||||
|
||||
### 2.3 Integration
|
||||
|
||||
Replace linear entity scans in `pipeline/mod.rs` render preparation with spatial queries:
|
||||
|
||||
```rust
|
||||
let candidates = scene.quadtree.query_rect(view_aabb);
|
||||
// only upload GPU buffers for candidates
|
||||
```
|
||||
|
||||
**Estimated gain:** near-constant frame cost regardless of total entity count when zoomed in.
|
||||
|
||||
---
|
||||
|
||||
## Phase 4 — GPU-Side Culling (Advanced)
|
||||
|
||||
**Goal:** Offload culling to the GPU; zero CPU cost for large entity counts.
|
||||
|
|
@ -89,8 +53,6 @@ Relevant only for perspective (3D) mode with many overlapping solids.
|
|||
## Implementation Order
|
||||
|
||||
```
|
||||
Phase 2.1 Quadtree for 2D medium complexity, scales 2D docs
|
||||
Phase 2.2 Octree for 3D medium, needed for dense 3D
|
||||
Phase 4.1 Indirect draw + GPU cull high complexity, defer
|
||||
Phase 4.2 Hi-Z occlusion high complexity, 3D only, last
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue