diff options
Diffstat (limited to 'src/gpu/effects/flash_effect.h')
| -rw-r--r-- | src/gpu/effects/flash_effect.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gpu/effects/flash_effect.h b/src/gpu/effects/flash_effect.h index 6be375d..8241557 100644 --- a/src/gpu/effects/flash_effect.h +++ b/src/gpu/effects/flash_effect.h @@ -5,14 +5,35 @@ #include "gpu/effect.h" #include "gpu/gpu.h" +#include "gpu/uniform_helper.h" + +// Parameters for FlashEffect (set at construction time) +struct FlashEffectParams { + float color[3] = {1.0f, 1.0f, 1.0f}; // Default: white + float decay_rate = 0.98f; // Default: fast decay + float trigger_threshold = 0.7f; // Default: trigger on strong beats +}; + +// Uniform data sent to GPU shader +struct FlashUniforms { + float flash_intensity; + float intensity; + float color[3]; // RGB flash color + float _pad; +}; class FlashEffect : public PostProcessEffect { public: + // Backward compatibility constructor (uses default params) FlashEffect(const GpuContext& ctx); + // New parameterized constructor + FlashEffect(const GpuContext& ctx, const FlashEffectParams& params); void render(WGPURenderPassEncoder pass, float time, float beat, float intensity, float aspect_ratio) override; void update_bind_group(WGPUTextureView input_view) override; private: + FlashEffectParams params_; + UniformBuffer<FlashUniforms> uniforms_; float flash_intensity_ = 0.0f; }; |
