diff options
Diffstat (limited to 'src/effects/chroma_aberration_effect.h')
| -rw-r--r-- | src/effects/chroma_aberration_effect.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/effects/chroma_aberration_effect.h b/src/effects/chroma_aberration_effect.h new file mode 100644 index 0000000..1790952 --- /dev/null +++ b/src/effects/chroma_aberration_effect.h @@ -0,0 +1,29 @@ +// This file is part of the 64k demo project. +// It declares the ChromaAberrationEffect. + +#pragma once + +#include "gpu/effect.h" +#include "gpu/uniform_helper.h" + +// Parameters for ChromaAberrationEffect (set at construction time) +struct ChromaAberrationParams { + float offset_scale = 0.02f; // Default: 2% screen offset + float angle = 0.0f; // Default: horizontal (0 radians) +}; + +class ChromaAberrationEffect : public PostProcessEffect { + public: + // Backward compatibility constructor (uses default params) + ChromaAberrationEffect(const GpuContext& ctx); + // New parameterized constructor + ChromaAberrationEffect(const GpuContext& ctx, + const ChromaAberrationParams& params); + void render(WGPURenderPassEncoder pass, + const CommonPostProcessUniforms& uniforms) override; + void update_bind_group(WGPUTextureView input_view) override; + + private: + ChromaAberrationParams params_; + UniformBuffer<ChromaAberrationParams> params_buffer_; +}; |
