diff options
Diffstat (limited to 'TODO.md')
| -rw-r--r-- | TODO.md | 40 |
1 files changed, 18 insertions, 22 deletions
@@ -2,7 +2,13 @@ This file tracks prioritized tasks with detailed attack plans. -## Recently Completed (February 4, 2026) +## Recently Completed (February 5, 2026) + +- [x] **Physics & Collision (Task #49)**: + - [x] **CPU-Side SDF Library**: Implemented `sdSphere`, `sdBox`, `sdTorus`, `sdPlane` in `src/3d/sdf_cpu.h` using `mini_math.h`. Added `calc_normal` for numerical gradients. + - [x] **BVH Construction**: Implemented `BVHNode` and `BVHBuilder` in `src/3d/bvh.h/cc`. Optimized broad-phase collision queries with `BVH::Query`. + - [x] **Physics System**: Created `PhysicsSystem` in `src/3d/physics.h/cc` implementing semi-implicit Euler integration, broad-phase BVH culling, and narrow-phase SDF proxy probing. + - [x] **Integration & Visualization**: Added `velocity`, `mass`, `is_static` to `Object3D`. Integrated physics loop into `test_3d_render.cc` and added BVH wireframe visualization to `VisualDebug`. - [x] **Audio Playback Debugging & Core Audio Optimization**: - [x] **Core Audio Timing Fix**: Resolved stop-and-go audio glitches caused by timing mismatch. Core Audio optimized for 44.1kHz (10ms periods), but 32kHz system expected ~13.78ms callbacks. Added `allowNominalSampleRateChange = TRUE` to force OS-level 32kHz native and `performanceProfile = conservative` for 4096-frame buffers (128ms). Result: Stable ~128ms callbacks, <1ms jitter, zero underruns. @@ -107,33 +113,23 @@ This file tracks prioritized tasks with detailed attack plans. - [x] **Enhanced Procedural Noise:** Implemented a multi-octave Value Noise generator for higher-quality skybox textures. - [x] **Scene Integrity:** Restored proper object indexing and removed redundant geometry, ensuring the floor grid and objects render correctly. -## Priority 1: Physics & Collision (Task #49) -**Goal**: Implement a lightweight physics engine using SDFs and BVH acceleration. (See `doc/3D.md` for design). - -- [ ] **Task #49.1: CPU-Side SDF Library**: - - [ ] Create `src/3d/sdf_cpu.h` implementing `sdSphere`, `sdBox`, `sdTorus`, `sdPlane` using `mini_math.h`. - - [ ] Implement `calc_normal` (numerical gradient) for these SDFs. - - [ ] Add unit tests in `src/tests/test_physics.cc` to verify CPU SDFs match ground truth. - -- [ ] **Task #49.2: BVH Construction**: - - [ ] Define `BVHNode` struct in `src/3d/bvh.h` (shared/compatible with GPU layout). - - [ ] Implement `BVHBuilder::Build(const std::vector<Object3D>&)` in `src/3d/bvh.cc`. - - [ ] Implement `BVH::Query(AABB)` for broad-phase collision detection. - - [ ] Visualize BVH in `src/tests/test_3d_render.cc` (using `VisualDebug`). - -- [ ] **Task #49.3: Physics Loop**: - - [ ] Create `PhysicsSystem` class in `src/3d/physics.h`. - - [ ] Implement `Update(dt)`: Integration -> Broad Phase -> Narrow Phase (SDF Probe) -> Resolution. - - [ ] Add `velocity`, `mass`, `restitution` fields to `Object3D`. - - [ ] Integrate into `test_3d_render.cc` main loop. - ## Priority 2: 3D System Enhancements (Task #18) **Goal:** Establish a pipeline for importing complex 3D scenes to replace hardcoded geometry. +- [ ] **Task #18.0: Basic OBJ Asset Pipeline** (New) + - [ ] Define `ASSET_MESH` type in `asset_manager`. + - [ ] Update `asset_packer` to parse simple `.obj` files (positions, normals, UVs) and serialize them. + - [ ] Update `Renderer3D` to handle `ObjectType::MESH` in the rasterization path. - [ ] **Task #36: Blender Exporter:** Create a Python script (`tools/blender_export.py`) to export meshes/cameras/lights to a binary asset format. - [ ] **Task #37: Asset Ingestion:** Update `asset_packer` to handle the new 3D binary format. -- [ ] **Task #38: Runtime Loader:** Implement a minimal C++ parser to load the scene data into the ECS/Renderer. + - [ ] **Task #38: Runtime Loader:** Implement a minimal C++ parser to load the scene data into the ECS/Renderer. + +- [ ] **Task #18-B: GPU BVH & Shadows** (Optimization) + - [ ] **Upload BVH:** Create a storage buffer for `BVHNode` data and upload the CPU-built BVH every frame in `Renderer3D`. + - [ ] **Shader Traversal:** Implement stack-based BVH traversal in `scene_query.wgsl` to replace the linear loop in `map_scene`. + - [ ] **Shadow Optimization:** Use the BVH traversal for `calc_shadow` to skip occluded objects efficiently. ## Priority 3: WGSL Modularization (Task #50) [RECURRENT] + **Goal**: Refactor `ShaderComposer` and WGSL assets to support granular, reusable snippets and `#include` directives. This is an ongoing task to maintain shader code hygiene as new features are added. ## Priority 4: Developer Tooling & CI |
