diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-16 16:16:13 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-16 16:16:13 +0100 |
| commit | a3583f4c704bb14e02f49cade6996e215d0ee6b4 (patch) | |
| tree | 340258c6791ac56ce54bc144befe83af4b0c5fea /src/effects/flash_effect.h | |
| parent | 6ac4fa8fb8c045232575036f4a140b9a0ec1995a (diff) | |
feat: Add FlashEffect for audio/visual sync testing
- FlashEffect: Beat-synchronized white flash using ShaderComposer
- Loads shader from assets (flash.wgsl) with sequence_uniforms include
- Uses pow(1.0 - beat_phase, 4.0) for sharp flash at beat start
- Updated test_demo.seq to use FlashEffect (was HeptagonEffect)
- Added FlashEffect to test suite (test_demo_effects.cc)
- Made cnn_test conditional on main workspace (fixes build error)
- Flash intensity: 1.0 at beat start, fades to 0.0 by beat end
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/effects/flash_effect.h')
| -rw-r--r-- | src/effects/flash_effect.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/effects/flash_effect.h b/src/effects/flash_effect.h new file mode 100644 index 0000000..b9bbff8 --- /dev/null +++ b/src/effects/flash_effect.h @@ -0,0 +1,26 @@ +// Flash effect for visual sync testing +// Pulses white based on beat timing + +#pragma once +#include "gpu/effect.h" +#include "gpu/uniform_helper.h" + +class FlashEffect : public Effect { + public: + FlashEffect(const GpuContext& ctx, + const std::vector<std::string>& inputs, + const std::vector<std::string>& outputs); + ~FlashEffect() override; + + void render(WGPUCommandEncoder encoder, + const UniformsSequenceParams& params, + NodeRegistry& nodes) override; + + private: + WGPURenderPipeline pipeline_; + WGPUBindGroup bind_group_; + WGPUSampler sampler_; + WGPUTexture dummy_texture_; + WGPUTextureView dummy_texture_view_; + UniformBuffer<UniformsSequenceParams> uniforms_buffer_; +}; |
