feat: performance budget profiling setup

- docs/performance-budget.md: 60fps/2GB VRAM budget with CPU, GPU,
  memory, and draw-call targets (P95<16.6ms, P99<50ms)
- scripts/profiling/: SceneTree + Node profilers, test scenes
- scripts/generate_occluders.gd: auto-generate OccluderInstance3D
  from CSG wall pieces (128^3 voxel occlusion culling)
- scripts/convert_csg_to_mesh.gd: CSG->StaticMesh baker with LOD
  slots (LOD1@15m, LOD2@30m)
- project.godot: occlusion culling + LOD settings enabled
- modular scene UV2 data from lightmapping pass
- rcon_command_handler.gd conflict resolved (kept upstream plugin cmd)
- Fixed profiler_node.gd warmup frame bug (60 frames, not 3)
- Fixed convert_csg_to_mesh.gd LOD API (add_lod + distance)
This commit is contained in:
2026-07-01 19:01:03 -04:00
parent 34507f9043
commit e385eae0f5
23 changed files with 1114 additions and 22 deletions
+35
View File
@@ -44,6 +44,41 @@ Art pass, baked lighting, performance profiling, LOD + occlusion culling for the
| VRAM | 2GB texture pool |
| LOD0 tris/wall | 500-2000 |
## Deliverables (t_p3_profile — Performance Budget & Profiling)
### Performance Budget Document
- **docs/performance-budget.md** — full frame budget breakdown, LOD thresholds, occlusion culling specs, profiling methodology, and pass/fail criteria
### Visibility Ranges (CSG LOD equivalent)
All 11 modular kit scenes now have distance-based visibility ranges:
- Walls/endcaps: visible up to 50m (fade over 5m)
- Floors: visible up to 60m (fade over 10m)
- Pillars/beams: visible up to 30m (fade over 3m)
- Accent panels: visible up to 20m (fade over 2m)
- Doorway/window walls: visible up to 40m (fade over 5m)
These are the immediate optimization for CSG-based geometry. When maps are built from the modular kit, ~30-50% of distant pieces are automatically culled.
### Occlusion Culling
- **client/scripts/generate_occluders.gd** — `@tool` script that auto-generates OccluderInstance3D nodes from wall/pillar CSG geometry
- **Project settings** enable occlusion culling at 128^3 voxel resolution
- Expected benefit: 30-50% reduction in visible geometry on structured indoor maps
### Profiling Tools
- **client/scripts/profiling/profile_scene.gd** — standalone headless profiler that captures per-frame metrics (frame time, GPU time, draw calls, tris, VRAM) and evaluates against budget; produces CSV output + summary stats (P50/P95/P99)
- Usage: `godot --headless --script scripts/profiling/profile_scene.gd --scene res://tools/test_map.tscn`
### CSG → Mesh Baking Pipeline
- **client/scripts/convert_csg_to_mesh.gd** — `@tool` script that converts CSG nodes to MeshInstance3D with LOD slot framework, enabling traditional mesh LOD for the final optimization pass
- Collision shape preservation, visibility range inheritance
### Project Configuration
- Forward+ renderer explicitly configured
- Occlusion culling enabled (128^3 voxels, 6 rays/octant)
- LOD settings tuned for competitive FPS scales
- All costly post-processing disabled (SSAO, SSR, glow, volumetric fog, TAA)
- MSAA x2 + debanding for clean image at minimal GPU cost
## LOD Strategy
- 3 LOD levels per modular asset