🔧 Use RGB for energize a color

This commit is contained in:
Simon Schneegans
2022-06-13 06:16:59 +02:00
parent ee902debe1
commit ad76fff308
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -3,5 +3,5 @@
// the effect. // the effect.
effect.setUniform(this.shader, 'uDuration', this.duration * 0.001); effect.setUniform(this.shader, 'uDuration', this.duration * 0.001);
effect.setUniform(this.shader, 'uColor', effect.readConfig('Color', 'white')); effect.setUniform(this.shader, 'uColor', this.readRGBConfig('Color'));
effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0)); effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0));
+3 -3
View File
@@ -13,7 +13,7 @@
// The content from common.glsl is automatically prepended to each shader effect. // The content from common.glsl is automatically prepended to each shader effect.
uniform vec4 uColor; uniform vec3 uColor;
uniform float uScale; uniform float uScale;
const float FADE_IN_TIME = 0.3; const float FADE_IN_TIME = 0.3;
@@ -63,7 +63,7 @@ void main() {
vec4 oColor = getInputColor(iTexCoord.st); vec4 oColor = getInputColor(iTexCoord.st);
// Dissolve window to effect color / transparency. // Dissolve window to effect color / transparency.
oColor.rgb = mix(uColor.rgb, oColor.rgb, 0.2 * masks.y + 0.8); oColor.rgb = mix(uColor, oColor.rgb, 0.2 * masks.y + 0.8);
oColor.a = oColor.a * masks.y; oColor.a = oColor.a * masks.y;
vec2 scaledUV = (iTexCoord.st - 0.5) * (1.0 + 0.1 * progress); vec2 scaledUV = (iTexCoord.st - 0.5) * (1.0 + 0.1 * progress);
@@ -81,7 +81,7 @@ void main() {
particles += 0.5 * pow(0.2 * (1.0 / (1.0 - atoms) - 1.0), 2.0); particles += 0.5 * pow(0.2 * (1.0 / (1.0 - atoms) - 1.0), 2.0);
} }
oColor.rgb += uColor.rgb * particles * masks.x; oColor.rgb += uColor * particles * masks.x;
oColor.a += particles * masks.x; oColor.a += particles * masks.x;
// These are pretty useful for understanding how this works. // These are pretty useful for understanding how this works.
+1 -1
View File
@@ -51,7 +51,7 @@ var EnergizeA = class {
const c = Clutter.Color.from_string(settings.get_string('energize-a-color'))[1]; const c = Clutter.Color.from_string(settings.get_string('energize-a-color'))[1];
// clang-format off // clang-format off
shader.set_uniform_float(shader._uColor, 4, [c.red / 255, c.green / 255, c.blue / 255, 1.0]); shader.set_uniform_float(shader._uColor, 3, [c.red / 255, c.green / 255, c.blue / 255]);
shader.set_uniform_float(shader._uScale, 1, [settings.get_double('energize-a-scale')]); shader.set_uniform_float(shader._uScale, 1, [settings.get_double('energize-a-scale')]);
// clang-format on // clang-format on
}); });