summaryrefslogtreecommitdiff
path: root/src/effects/rotating_cube_effect.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-16 14:32:59 +0100
committerskal <pascal.massimino@gmail.com>2026-02-16 14:32:59 +0100
commitb2ede3f0680edc894a54e28374cb87ab2690afa2 (patch)
tree69e0a8c04eb29be953b037eb98e0a9ac0f1b417a /src/effects/rotating_cube_effect.h
parent0fd3c982247d05bacbd67db08c865ec67602437f (diff)
refactor: remove v2 versioning artifacts, establish Sequence as canonical system
Complete v1→v2 migration cleanup: rename 29 files (sequence_v2→sequence, effect_v2→effect, 14 effect files, 8 shaders, compiler, docs), update all class names and references across 54 files. Archive v1 timeline. System now uses standard naming with all versioning removed. 30/34 tests passing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/effects/rotating_cube_effect.h')
-rw-r--r--src/effects/rotating_cube_effect.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/effects/rotating_cube_effect.h b/src/effects/rotating_cube_effect.h
new file mode 100644
index 0000000..1c0155a
--- /dev/null
+++ b/src/effects/rotating_cube_effect.h
@@ -0,0 +1,49 @@
+// This file is part of the 64k demo project.
+// It declares RotatingCubeEffect (simplified v2 port).
+
+#pragma once
+
+#include "gpu/effect.h"
+#include "gpu/gpu.h"
+#include "gpu/uniform_helper.h"
+#include "util/mini_math.h"
+
+class RotatingCubeEffect : public Effect {
+ public:
+ RotatingCubeEffect(const GpuContext& ctx,
+ const std::vector<std::string>& inputs,
+ const std::vector<std::string>& outputs);
+ ~RotatingCubeEffect() override;
+
+ void declare_nodes(NodeRegistry& registry) override;
+ void render(WGPUCommandEncoder encoder,
+ const UniformsSequenceParams& params,
+ NodeRegistry& nodes) override;
+
+ private:
+ struct Uniforms {
+ mat4 view_proj;
+ mat4 inv_view_proj;
+ vec4 camera_pos_time;
+ vec4 params;
+ vec2 resolution;
+ float aspect_ratio;
+ float _pad;
+ };
+ static_assert(sizeof(Uniforms) == 176, "Uniforms size mismatch");
+
+ struct ObjectData {
+ mat4 model;
+ mat4 inv_model;
+ vec4 color;
+ vec4 params;
+ };
+ static_assert(sizeof(ObjectData) == 160, "ObjectData size mismatch");
+
+ WGPURenderPipeline pipeline_ = nullptr;
+ WGPUBindGroup bind_group_ = nullptr;
+ GpuBuffer uniform_buffer_;
+ GpuBuffer object_buffer_;
+ float rotation_ = 0.0f;
+ std::string depth_node_;
+};