diff options
Diffstat (limited to 'src/effects/vignette_effect.h')
| -rw-r--r-- | src/effects/vignette_effect.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/effects/vignette_effect.h b/src/effects/vignette_effect.h new file mode 100644 index 0000000..f891d14 --- /dev/null +++ b/src/effects/vignette_effect.h @@ -0,0 +1,26 @@ +// This file is part of the 64k demo project. +// It declares the VignetteEffect. + +#pragma once + +#include "gpu/effect.h" +#include "gpu/uniform_helper.h" + +// Parameters for VignetteEffect +struct VignetteParams { + float radius = 0.5f; // Radius of the clear center + float softness = 0.5f; // Softness of the vignette edge +}; + +class VignetteEffect : public PostProcessEffect { + public: + VignetteEffect(const GpuContext& ctx); + VignetteEffect(const GpuContext& ctx, const VignetteParams& params); + void render(WGPURenderPassEncoder pass, + const CommonPostProcessUniforms& uniforms) override; + void update_bind_group(WGPUTextureView input_view) override; + + private: + VignetteParams params_; + UniformBuffer<VignetteParams> params_buffer_; +}; |
