From 8bdc4754647c9c6691130fa91d51fee93c5fc88f Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 10:51:15 +0100 Subject: feat: Implement 3D system and procedural texture manager - Extended mini_math.h with mat4 multiplication and affine transforms. - Implemented TextureManager for runtime procedural texture generation and GPU upload. - Added 3D system components: Camera, Object, Scene, and Renderer3D. - Created test_3d_render mini-demo for interactive 3D verification. - Fixed WebGPU validation errors regarding depthSlice and unimplemented WaitAny. --- PROJECT_CONTEXT.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'PROJECT_CONTEXT.md') diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md index fb4485d..b990347 100644 --- a/PROJECT_CONTEXT.md +++ b/PROJECT_CONTEXT.md @@ -43,9 +43,30 @@ Incoming tasks in no particular order: - `MainSequence`: Manages global resources (`device`, `queue`) and orchestrates the frame render. - Refactored `gpu.cc` to use `MainSequence`. - Moved concrete effects to `src/gpu/demo_effects.cc`. +- 13. Implement Procedural Texture system (Task #3 -> #1): + - `src/procedural/` module (Done). + - Integration with WebGPU: Generate textures at runtime and upload to GPU (Done). + - `src/gpu/texture_manager` implemented and tested. +- 14. Implement 3D system (Task #1 -> #2): + - `src/3d/` module (math, camera, scene, renderer) (Done). + - `Renderer3D` implemented with basic cube rendering (Done). + - `test_3d_render` mini-demo created (Debugging crash in `wgpuInstanceWaitAny`). +- 15. Shader Logic (Task #2 -> #3): + - Ray-object intersection & SDF rendering in WGSL. ## Session Decisions and Current State +### 3D Renderer Implementation +- **Renderer3D**: Encapsulates pipeline creation and render pass recording. +- **Shader**: Currently uses a simple vertex/fragment shader for cubes. +- **Storage**: Objects are stored in a `StorageBuffer` (instance data). +- **Test Tool**: `test_3d_render` created to isolate 3D development. +- **Issue**: `test_3d_render` crashes with "not implemented" in `wgpuInstanceWaitAny` on macOS. + +### Procedural Textures +- **TextureManager**: Handles CPU generation -> GPU upload. +- **API**: Supports `WGPUTexelCopyTextureInfo` (new API) with fallback macros for older headers. + ### Sequence & Effect System - **Architecture**: Implemented a hierarchical sequencing system. - **Effect**: Abstract base for visual elements. Supports `compute` (physics) and `render` (draw) phases. Idempotent `init` for shared asset loading. -- cgit v1.2.3