🔧 Pass testMode flag to shaders

This commit is contained in:
Simon Schneegans
2023-01-29 20:41:40 +01:00
parent 96d098daba
commit 72f9c8eefc
13 changed files with 83 additions and 109 deletions
+1 -4
View File
@@ -51,12 +51,9 @@ var Glitch = class {
shader._uSpeed = shader.get_uniform_location('uSpeed');
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings) => {
shader.connect('begin-animation', (shader, settings, forOpening, testMode) => {
const c = Clutter.Color.from_string(settings.get_string('glitch-color'))[1];
// If we are performing an integration tests, we use a fixed seed.
const testMode = settings.get_boolean('test-mode');
// clang-format off
shader.set_uniform_float(shader._uSeed, 1, [testMode ? 0 : Math.random()]);
shader.set_uniform_float(shader._uColor, 4, [c.red / 255, c.green / 255, c.blue / 255, c.alpha / 255]);