🔧 Fixes for kwin

This commit is contained in:
Simon Schneegans
2022-06-10 10:29:47 +02:00
parent 9f8258b9f8
commit bfc3467e33
4 changed files with 13 additions and 13 deletions
+5 -5
View File
@@ -13,13 +13,13 @@
// The content from common.glsl is automatically prepended to each shader effect.
uniform vec3 uColor;
uniform vec4 uColor;
uniform float uScale;
const float FADE_IN_TIME = 0.3;
const float FADE_OUT_TIME = 0.6;
const float HEART_FADE_TIME = 0.3;
const float EDGE_FADE_WIDTH = 50;
const float EDGE_FADE_WIDTH = 50.0;
// This method returns two values:
// result.x: A mask for the particles.
@@ -63,7 +63,7 @@ void main() {
vec4 oColor = getInputColor(iTexCoord.st);
// Dissolve window to effect color / transparency.
oColor.rgb = mix(uColor, oColor.rgb, 0.2 * masks.y + 0.8);
oColor.rgb = mix(uColor.rgb, oColor.rgb, 0.2 * masks.y + 0.8);
oColor.a = oColor.a * masks.y;
vec2 scaledUV = (iTexCoord.st - 0.5) * (1.0 + 0.1 * progress);
@@ -75,13 +75,13 @@ void main() {
float particles = 0.2 * pow((simplex3D(vec3(uv, 0.0 * uProgress * uDuration))), 3.0);
// Add more molecule particles.
for (int i = 1; i <= 3; ++i) {
for (float i = 1.0; i <= 3.0; ++i) {
vec2 uv = scaledUV * 0.12154 / pow(1.5, i) * uSize;
float atoms = simplex3D(vec3(uv, 2.0 * uProgress * uDuration / i));
particles += 0.5 * pow(0.2 * (1.0 / (1.0 - atoms) - 1.0), 2.0);
}
oColor.rgb += uColor * particles * masks.x;
oColor.rgb += uColor.rgb * particles * masks.x;
oColor.a += particles * masks.x;
// These are pretty useful for understanding how this works.
+6 -6
View File
@@ -13,13 +13,13 @@
// The content from common.glsl is automatically prepended to each shader effect.
uniform vec3 uColor;
uniform vec4 uColor;
uniform float uScale;
const float SHOWER_TIME = 0.3;
const float SHOWER_WIDTH = 0.3;
const float STREAK_TIME = 0.6;
const float EDGE_FADE = 50;
const float EDGE_FADE = 50.0;
// This method returns four values:
// result.x: A mask for the particles which lead the shower.
@@ -80,28 +80,28 @@ void main() {
vec4 oColor = getInputColor(iTexCoord.st);
// Dissolve window to effect color / transparency.
oColor.rgb = mix(uColor, oColor.rgb, 0.5 * masks.w + 0.5);
oColor.rgb = mix(uColor.rgb, oColor.rgb, 0.5 * masks.w + 0.5);
oColor.a = oColor.a * masks.w;
// Add leading shower particles.
vec2 showerUV = iTexCoord.st + vec2(0.0, -0.7 * progress / SHOWER_TIME);
showerUV *= 0.02 * uSize / uScale;
float shower = pow(simplex2D(showerUV), 10.0);
oColor.rgb += uColor * shower * masks.x;
oColor.rgb += uColor.rgb * shower * masks.x;
oColor.a += shower * masks.x;
// Add trailing streak lines.
vec2 streakUV = iTexCoord.st + vec2(0.0, -progress / SHOWER_TIME);
streakUV *= vec2(0.05 * uSize.x, 0.001 * uSize.y) / uScale;
float streaks = simplex2DFractal(streakUV) * 0.5;
oColor.rgb += uColor * streaks * masks.y;
oColor.rgb += uColor.rgb * streaks * masks.y;
oColor.a += streaks * masks.y;
// Add glimmering atoms.
vec2 atomUV = iTexCoord.st + vec2(0.0, -0.025 * progress / SHOWER_TIME);
atomUV *= 0.2 * uSize / uScale;
float atoms = pow((simplex3D(vec3(atomUV, uProgress * uDuration))), 5.0);
oColor.rgb += uColor * atoms * masks.z;
oColor.rgb += uColor.rgb * atoms * masks.z;
oColor.a += atoms * masks.z;
// These are pretty useful for understanding how this works.