🔧 Use vec4 for color

This commit is contained in:
Simon Schneegans
2022-06-09 08:28:48 +02:00
parent 67d6df0a70
commit 3360b45c18
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -13,7 +13,7 @@
// The content from common.glsl is automatically prepended to each shader effect.
uniform vec3 uColor;
uniform vec4 uColor;
const float BLUR_WIDTH = 0.01; // Width of the gradients.
const float TB_TIME = 0.7; // Relative time for the top/bottom animation.
@@ -61,7 +61,7 @@ void main() {
oColor.rgb /= oColor.a;
}
oColor.rgb = mix(oColor.rgb, uColor * oColor.a, smoothstep(0.0, 1.0, prog));
oColor.rgb = mix(oColor.rgb, uColor.rgb * oColor.a, smoothstep(0.0, 1.0, prog));
oColor.a *= mask;
// These are pretty useful for understanding how this works.
+2 -2
View File
@@ -50,8 +50,8 @@ var TVEffect = class {
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings) => {
const c = Clutter.Color.from_string(settings.get_string('tv-effect-color'))[1];
shader.set_uniform_float(shader._uColor, 3,
[c.red / 255, c.green / 255, c.blue / 255]);
shader.set_uniform_float(shader._uColor, 4,
[c.red / 255, c.green / 255, c.blue / 255, 1.0]);
});
});
}