🔧 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 -5
View File
@@ -53,7 +53,7 @@ var Hexagon = class {
shader._uLineColor = shader.get_uniform_location('uLineColor');
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings) => {
shader.connect('begin-animation', (shader, settings, forOpening, testMode) => {
// Get the two configurable colors. They are directly injected into the shader
// code below.
const gc =
@@ -61,10 +61,6 @@ var Hexagon = class {
const lc =
Clutter.Color.from_string(settings.get_string('hexagon-line-color'))[1];
// If we are currently performing integration test, the animation uses a fixed
// seed.
const testMode = settings.get_boolean('test-mode');
// clang-format off
shader.set_uniform_float(shader._uAdditiveBlending, 1, [settings.get_boolean('hexagon-additive-blending')]);
shader.set_uniform_float(shader._uSeed, 2, [testMode ? 0 : Math.random(), testMode ? 0 : Math.random()]);