diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-17 13:24:56 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-17 13:24:56 +0100 |
| commit | e3f0b002c0998c8553e782273b254869107ffc0f (patch) | |
| tree | e1e5f8a6c5d119e7764d8d7a43b43bc0c65f4e78 /src/gpu/sequence.cc | |
| parent | bdb1a4e95a545f3f4d88630b8aec6ab771776d99 (diff) | |
feat(uniforms): Add noise field with per-frame random values
Replace _pad with noise field in UniformsSequenceParams, providing
effects with non-deterministic random values [0..1] updated each frame.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/gpu/sequence.cc')
| -rw-r--r-- | src/gpu/sequence.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gpu/sequence.cc b/src/gpu/sequence.cc index 901d560..9de4133 100644 --- a/src/gpu/sequence.cc +++ b/src/gpu/sequence.cc @@ -4,6 +4,7 @@ #include "gpu/effect.h" #include "util/fatal_error.h" #include <algorithm> +#include <random> // NodeRegistry implementation @@ -227,7 +228,11 @@ void Sequence::preprocess(float seq_time, float beat_time, float beat_phase, params_.beat_time = beat_time; params_.beat_phase = beat_phase; params_.audio_intensity = audio_intensity; - params_._pad = 0.0f; + + static std::random_device rd; + static std::mt19937 gen(rd()); + static std::uniform_real_distribution<float> dis(0.0f, 1.0f); + params_.noise = dis(gen); uniforms_buffer_.update(ctx_.queue, params_); } |
