diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-16 10:00:30 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-16 10:00:30 +0100 |
| commit | a126caf9e52b8f7c5be8e09b303e741aa9a410cb (patch) | |
| tree | 12a74c3dfc4ca0eba5807a323564118713b957a8 /src/effects/particles_effect_v2.h | |
| parent | ce246924ac12da5639cce049c7bb2e29de7ed637 (diff) | |
feat(sequence): port particles_effect to v2
- Add ParticlesEffectV2 with compute + render passes
- Create particle_compute_v2.wgsl and particle_render_v2.wgsl
- Use UniformsSequenceParams for beat-synchronized particles
- Update timeline_v2.seq particles sequence (simplified 2-effect chain)
- Add shader exports to shaders.{h,cc}
- All 36 tests passing
handoff(Claude): Particles v2 complete, rotating_cube next
Diffstat (limited to 'src/effects/particles_effect_v2.h')
| -rw-r--r-- | src/effects/particles_effect_v2.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/effects/particles_effect_v2.h b/src/effects/particles_effect_v2.h new file mode 100644 index 0000000..f0f260c --- /dev/null +++ b/src/effects/particles_effect_v2.h @@ -0,0 +1,35 @@ +// This file is part of the 64k demo project. +// It declares the ParticlesEffectV2. + +#pragma once + +#include "gpu/effect_v2.h" +#include "gpu/gpu.h" +#include "gpu/uniform_helper.h" +#include <vector> + +// Particle structure +static const int NUM_PARTICLES = 10000; + +struct Particle { + float pos[4]; + float vel[4]; + float rot[4]; + float color[4]; +}; + +class ParticlesEffectV2 : public EffectV2 { + public: + ParticlesEffectV2(const GpuContext& ctx, + const std::vector<std::string>& inputs, + const std::vector<std::string>& outputs); + void render(WGPUCommandEncoder encoder, + const UniformsSequenceParams& params, + NodeRegistry& nodes) override; + + private: + ComputePass compute_pass_; + RenderPass render_pass_; + GpuBuffer particles_buffer_; + UniformBuffer<UniformsSequenceParams> uniforms_; +}; |
