From a3583f4c704bb14e02f49cade6996e215d0ee6b4 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 16 Feb 2026 16:16:13 +0100 Subject: 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 --- src/effects/flash_effect.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/effects/flash_effect.h (limited to 'src/effects/flash_effect.h') 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& inputs, + const std::vector& 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 uniforms_buffer_; +}; -- cgit v1.2.3