From b650afa7e05bfc127275778042443a729cb395f8 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 8 Feb 2026 16:46:27 +0100 Subject: update doc --- doc/COMPLETED.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/COMPLETED.md') diff --git a/doc/COMPLETED.md b/doc/COMPLETED.md index bac7206..a4e6a94 100644 --- a/doc/COMPLETED.md +++ b/doc/COMPLETED.md @@ -4,6 +4,25 @@ This file tracks recently completed tasks, organized by completion date. ## Recently Completed (February 8, 2026) +- [x] **Shader Parametrization System (Task #73 Phase 0)** (February 8, 2026) + - **Goal**: Enable per-frame dynamic parameters for shaders and effects via uniform buffers and .seq syntax + - **Implementation**: + - **Phase 1**: Created `UniformHelper` template in `src/gpu/uniform_helper.h` for type-safe uniform buffer management + - **Phase 2**: Added `FlashEffectParams` struct (color[3], decay_rate, trigger_threshold) and `FlashUniforms` struct with proper WGSL alignment + - **Phase 3**: Updated `flash_effect.cc` WGSL shader to use parameterized `flash_color` instead of hardcoded white + - **Phase 4**: Implemented per-frame parameter computation in `render()` method - animates color based on time/beat using sinusoidal modulation + - **Phase 5**: Extended `seq_compiler.cc` to parse key=value parameters from .seq files and generate struct initialization code + - **Critical Bugfix**: Fixed WGSL alignment issue where FlashUniforms was 24 bytes in C++ but shader expected 32 bytes + - Root cause: `vec3` has 16-byte alignment despite 12-byte size + - Solution: Added explicit padding (`_pad1[2]`, `_pad2`) and static_assert to enforce 32-byte struct size + - Result: Eliminated "Buffer is bound with size 24 where the shader expects 32" validation error + - **Syntax**: `EFFECT + FlashEffect 0 1 color=1.0,0.5,0.5 decay=0.95` in demo.seq + - **Files**: 11 changed (808+ / 40-), 3 new (uniform_helper.h, test_uniform_helper.cc, SHADER_PARAMETRIZATION_PLAN.md) + - **Result**: All 32/32 tests passing, demo runs without validation errors, system ready for extension to other effects + - **Commits**: c7d1dd7 (feature implementation), 775c0ea (alignment fix) + - **Size Impact**: ~400-500 bytes net (UniformHelper overhead + per-effect params) + - **Next**: Task #73 - Extend to ChromaAberrationEffect, GaussianBlurEffect, DistortEffect, SolarizeEffect + - [x] **3D Rendering & Shadow Improvements (Task A)** (February 8, 2026) - [x] **Task A.1 (Shadow Investigation)**: Investigated mesh shadows appearing as bounding boxes. Documented that this is a design limitation of the hybrid renderer (AABB proxy for meshes in SDF pass). Created `doc/DEBUG_SHADOWS.md` with detailed analysis. - [x] **Task A.2 (Plane Scaling Fix)**: Fixed `ObjectType::PLANE` distance calculation for non-uniform scaling. -- cgit v1.2.3