🔧 Use RGB for energize b color
This commit is contained in:
@@ -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));
|
||||||
|
|||||||
@@ -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 SHOWER_TIME = 0.3;
|
const float SHOWER_TIME = 0.3;
|
||||||
@@ -80,28 +80,28 @@ 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.5 * masks.w + 0.5);
|
oColor.rgb = mix(uColor, oColor.rgb, 0.5 * masks.w + 0.5);
|
||||||
oColor.a = oColor.a * masks.w;
|
oColor.a = oColor.a * masks.w;
|
||||||
|
|
||||||
// Add leading shower particles.
|
// Add leading shower particles.
|
||||||
vec2 showerUV = iTexCoord.st + vec2(0.0, -0.7 * progress / SHOWER_TIME);
|
vec2 showerUV = iTexCoord.st + vec2(0.0, -0.7 * progress / SHOWER_TIME);
|
||||||
showerUV *= 0.02 * uSize / uScale;
|
showerUV *= 0.02 * uSize / uScale;
|
||||||
float shower = pow(simplex2D(showerUV), 10.0);
|
float shower = pow(simplex2D(showerUV), 10.0);
|
||||||
oColor.rgb += uColor.rgb * shower * masks.x;
|
oColor.rgb += uColor * shower * masks.x;
|
||||||
oColor.a += shower * masks.x;
|
oColor.a += shower * masks.x;
|
||||||
|
|
||||||
// Add trailing streak lines.
|
// Add trailing streak lines.
|
||||||
vec2 streakUV = iTexCoord.st + vec2(0.0, -progress / SHOWER_TIME);
|
vec2 streakUV = iTexCoord.st + vec2(0.0, -progress / SHOWER_TIME);
|
||||||
streakUV *= vec2(0.05 * uSize.x, 0.001 * uSize.y) / uScale;
|
streakUV *= vec2(0.05 * uSize.x, 0.001 * uSize.y) / uScale;
|
||||||
float streaks = simplex2DFractal(streakUV) * 0.5;
|
float streaks = simplex2DFractal(streakUV) * 0.5;
|
||||||
oColor.rgb += uColor.rgb * streaks * masks.y;
|
oColor.rgb += uColor * streaks * masks.y;
|
||||||
oColor.a += streaks * masks.y;
|
oColor.a += streaks * masks.y;
|
||||||
|
|
||||||
// Add glimmering atoms.
|
// Add glimmering atoms.
|
||||||
vec2 atomUV = iTexCoord.st + vec2(0.0, -0.025 * progress / SHOWER_TIME);
|
vec2 atomUV = iTexCoord.st + vec2(0.0, -0.025 * progress / SHOWER_TIME);
|
||||||
atomUV *= 0.2 * uSize / uScale;
|
atomUV *= 0.2 * uSize / uScale;
|
||||||
float atoms = pow((simplex3D(vec3(atomUV, uProgress * uDuration))), 5.0);
|
float atoms = pow((simplex3D(vec3(atomUV, uProgress * uDuration))), 5.0);
|
||||||
oColor.rgb += uColor.rgb * atoms * masks.z;
|
oColor.rgb += uColor * atoms * masks.z;
|
||||||
oColor.a += atoms * masks.z;
|
oColor.a += atoms * masks.z;
|
||||||
|
|
||||||
// These are pretty useful for understanding how this works.
|
// These are pretty useful for understanding how this works.
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ var EnergizeB = class {
|
|||||||
const c = Clutter.Color.from_string(settings.get_string('energize-b-color'))[1];
|
const c = Clutter.Color.from_string(settings.get_string('energize-b-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-b-scale')]);
|
shader.set_uniform_float(shader._uScale, 1, [settings.get_double('energize-b-scale')]);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user