summaryrefslogtreecommitdiff
path: root/src/gpu/effects/theme_modulation_effect.h
blob: 713347bfbd1326c21ca265593baf984eb2278a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// This file is part of the 64k demo project.
// It implements a theme modulation effect that alternates between bright and
// dark. Pattern changes every 2 seconds, so we alternate every 4 seconds (2
// patterns).

#pragma once
#include "gpu/effect.h"
#include "gpu/effects/post_process_helper.h"
#include "gpu/uniform_helper.h"

class ThemeModulationEffect : public PostProcessEffect {
 public:
  ThemeModulationEffect(const GpuContext& ctx);
  void render(WGPURenderPassEncoder pass, float time, float beat,
              float intensity, float aspect_ratio) override;
  void update_bind_group(WGPUTextureView input_view) override;

 private:
  GpuBuffer params_buffer_;
};