diff options
Diffstat (limited to 'src/effects/flash_cube_effect.h')
| -rw-r--r-- | src/effects/flash_cube_effect.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/effects/flash_cube_effect.h b/src/effects/flash_cube_effect.h new file mode 100644 index 0000000..df30b5b --- /dev/null +++ b/src/effects/flash_cube_effect.h @@ -0,0 +1,28 @@ +// This file is part of the 64k demo project. +// It implements a flashing cube effect with Perlin noise texture. +// The cube is large and we're inside it, flashing in sync with the beat. + +#pragma once +#include "3d/camera.h" +#include "3d/renderer.h" +#include "3d/scene.h" +#include "gpu/effect.h" +#include "gpu/texture_manager.h" + +class FlashCubeEffect : public Effect { + public: + FlashCubeEffect(const GpuContext& ctx); + void init(MainSequence* demo) override; + void resize(int width, int height) override; + void render(WGPURenderPassEncoder pass, + const CommonPostProcessUniforms& uniforms) override; + + private: + Renderer3D renderer_; + TextureManager texture_manager_; + Scene scene_; + Camera camera_; + float last_beat_ = 0.0f; + float flash_intensity_ = 0.0f; + bool initialized_ = false; +}; |
