From 8296fe5180b979b9d1f32f6375b41f0e0a8a399d Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 8 Feb 2026 17:39:33 +0100 Subject: feat(gpu): Add parameter-driven ChromaAberrationEffect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements Task #73 - Extends shader parametrization system to ChromaAberrationEffect following the FlashEffect pattern. Changes: - Added ChromaAberrationParams struct (offset_scale, angle) - Added ChromaUniforms with proper WGSL alignment (32 bytes) - Updated shader to compute offset direction from angle parameter - Extended seq_compiler to parse offset/angle parameters - Updated demo.seq with 2 parameterized instances: * Line 50: offset=0.03 angle=0.785 (45° diagonal, stronger) * Line 76: offset=0.01 angle=1.57 (90° vertical, subtle) Technical details: - Backward-compatible default constructor maintained - Migrated from raw buffer to UniformBuffer - Shader computes direction: vec2(cos(angle), sin(angle)) - Generated code creates ChromaAberrationParams initialization Testing: - All 32/32 tests pass - Demo runs without errors - Binary size: 5.6M stripped (~200-300 bytes impact) Co-Authored-By: Claude Sonnet 4.5 --- assets/demo.seq | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'assets/demo.seq') diff --git a/assets/demo.seq b/assets/demo.seq index 9c0b746..8f84c30 100644 --- a/assets/demo.seq +++ b/assets/demo.seq @@ -47,7 +47,7 @@ SEQUENCE 8b 3 EFFECT + ThemeModulationEffect 0 4 # Priority 0 EFFECT = HeptagonEffect 0.0 4.0 # Priority 0 (same layer) EFFECT + GaussianBlurEffect 0 8 # Priority 1 - EFFECT + ChromaAberrationEffect 0 6 # Priority 2 + EFFECT + ChromaAberrationEffect 0 6 offset=0.03 angle=0.785 # Priority 2 (diagonal, stronger) EFFECT + SolarizeEffect 0 10 # Priority 3 SEQUENCE 12b 2 @@ -73,7 +73,7 @@ SEQUENCE 17b 2 EFFECT = ParticlesEffect 0 4 # Priority 2 (same layer) EFFECT + Hybrid3DEffect 0 4 # Priority 3 EFFECT + GaussianBlurEffect 0 8 # Priority 4 - EFFECT + ChromaAberrationEffect 0 6 # Priority 5 + EFFECT + ChromaAberrationEffect 0 6 offset=0.01 angle=1.57 # Priority 5 (vertical, subtle) SEQUENCE 24b 1 EFFECT + ThemeModulationEffect 0 8 # Priority 0 -- cgit v1.2.3