summaryrefslogtreecommitdiff
path: root/src/effects/shaders.h
AgeCommit message (Collapse)Author
37 hoursfeat(cnn_v3): Phase 4 complete — CNNv3Effect C++ + FiLM uniform uploadskal
- cnn_v3/src/cnn_v3_effect.{h,cc}: full Effect subclass with 5 compute passes (enc0→enc1→bottleneck→dec1→dec0), shared weights storage buffer, per-pass uniform buffers, set_film_params() API - Fixed WGSL/C++ struct alignment: vec3u has align=16, so CnnV3Params4ch is 64 bytes and CnnV3ParamsEnc1 is 96 bytes (not 48/80) - Weight offsets computed as explicit formulas (e.g. 20*4*9+4) for clarity - Registered in CMake, shaders.h/cc, demo_effects.h, test_demo_effects.cc - 35/35 tests pass handoff(Gemini): CNN v3 Phase 5 next — parity validation (Python ref vs WGSL)
3 daysfeat(cnn_v3): Phase 1 complete - GBufferEffect integrated + HOWTO playbookskal
- Wire GBufferEffect into demo build: assets.txt, DemoSourceLists.cmake, demo_effects.h, shaders.h/cc. ShaderComposer::Compose() applied to gbuf_raster.wgsl (resolves #include "common_uniforms"). - Add GBufferEffect construction test. 35/35 passing. - Write cnn_v3/docs/HOWTO.md: G-buffer wiring, training data prep, training plan, per-pixel validation workflow, phase status table, troubleshooting guide. - Add project hooks: remind to update HOWTO.md on cnn_v3/ edits; warn on direct str_view(*_wgsl) usage bypassing ShaderComposer. - Update PROJECT_CONTEXT.md and TODO.md: Phase 1 done, Phase 3 (WGSL U-Net shaders) is next active. handoff(Gemini): CNN v3 Phase 3 is next - WGSL enc/dec/bottleneck/FiLM shaders in cnn_v3/shaders/. See cnn_v3/docs/CNN_V3.md Architecture section and cnn_v3/docs/HOWTO.md section 3 for spec. GBufferEffect outputs feat_tex0 + feat_tex1 (rgba32uint, 20ch, 32 bytes/pixel). C++ CNNv3Effect (Phase 4) takes those as input nodes.
12 daysntsc: factor common code into snippet; add RGB and YIQ input variantsskal
- Extract shared NTSC logic into render/ntsc_common.wgsl snippet - sample_ntsc_signal() hook decouples input format from processing - ntsc_rgb.wgsl: RGB input (converts via rgba_to_luma_chroma_phase) - ntsc_yiq.wgsl: YIQ passthrough for RotatingCube output - Add NtscYiq WgslEffect thin wrapper; register both in tests handoff(Claude): NTSC refactor complete; NtscYiq ready for timeline use with RotatingCube. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07feat(effects): add Ntsc post-process effect with fisheye distortionskal
WGSL-only WgslEffect implementing barrel/fisheye distortion, RGB chroma separation, scanlines, per-pixel temporal noise, rolling jitter line, vignette, and warm NTSC phosphor tint. Applied across all main sequences. handoff(Gemini): Ntsc effect added; 13 effects total, 35+1 tests expected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06feat(effects): add Scratch post-process effect with reusable scratch_lines ↵skal
snippet - src/shaders/render/scratch_lines.wgsl: reusable WGSL snippet registered as "render/scratch_lines"; call scratch_lines(uv, resolution, time)->f32 from any effect. Uses hash_1f from math/noise; 8 lines/frame, ~24fps flicker. - src/effects/scratch.{wgsl,h,cc}: thin Scratch effect wrapping the snippet. - Applied to "intro" and "rotating_cube" sequences as the final step. - 35/35 tests passing. handoff(Gemini): Scratch effect added. render/scratch_lines snippet is reusable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28fix(tools/shadertoy): fix Next Steps instructions and update EFFECT_WORKFLOW.mdskal
- Fix assets.txt path: shaders/xxx.wgsl (not ../../src/shaders/) - Fix shader output path to workspaces/main/shaders/ - Step 5: reference cmake/DemoSourceLists.cmake COMMON_GPU_EFFECTS (not CMakeLists.txt GPU_SOURCES) - Add step for test_demo_effects.cc Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20feat(sequence): port Scene1Effect + fix seq_compiler absolute time bugskal
- Add Scene1 effect: raymarching cube+sphere+ground (reflections, shadows) - Fix scene1.wgsl: binding 0→2, CommonUniforms→UniformsSequenceParams - Replace Heptagon+Placeholder stub in heptagon_scene with Scene1 - Fix seq_compiler.py: emit seq.start_time+effect.start/end (absolute times) so dispatch_render active check works correctly for all sequences Bug: effects in sequences starting after t=0 were never active because local times (e.g. 0-8) never satisfied params.time<end for absolute time 20+. 34/34 tests passing. handoff(Gemini): seq_compiler now emits absolute effect times. All existing sequences affected — verify visual output across the full timeline. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-17refactor: move shaders.{h,cc} to src/effects and remove v2 suffixskal
- Removed unused v1 shader declarations (13 variables) - Removed _v2 suffix from active shader names - Moved shaders.{h,cc} from src/gpu to src/effects - Updated all includes and build references - All tests pass (34/34) handoff(Claude): Cleaned up shader management, tests passing