wlbg: swap shader

This commit is contained in:
LordMZTE 2024-01-10 18:00:14 +01:00
parent 76e9c9d4c1
commit 3f61065096
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -8,21 +8,45 @@ in vec2 fragCoord;
out vec4 fragColor; out vec4 fragColor;
// shader: https://www.shadertoy.com/view/mtGBzm // shader: https://www.shadertoy.com/view/fljSDW
float sq(float x) { float sq(float x) {
return x*x; return x*x;
} }
void main() { void main() {
vec2 p = fragCoord; vec2 u = fragCoord;
vec3 col; vec4 o = vec4(0);
for(float j = 0.0; j < 3.0; j++){ vec2 R = vec2(1);
for(float i = 1.0; i < 10.0; i++){ ivec4 b = ivec4(o -= o); // Initialize b=0
p.x += 0.2 / (i + j) * cos(i * 5.0 * p.y + time ); float t = .1*time, B, h, z;
p.y += 0.2 / (i + j)* cos(i * 5.0 * p.x + time ); vec4 g;
}
col[int(j)] = sin(.5 * 7.0*sq(p.x)) + sin(7.0*sq(p.y)); u =
} (5. + cos(t) * 1.5) * // * Camera push in/out
fragColor = vec4(1.) - vec4(col, 1.); (u+u)/R.y // Center coordinates
* mat2( cos( vec4(0,33,55,0) - .1*t)) // * Rotate camera
;
z = (h = cos(B = floor(atan(u.x, u.y) * 2e2))) / dot(u,u); //Variables for Rain
for (; (b.x^b.y^b.z)%199 > b.z-16 ; ) // XOR function for towers
g += pow(vec4(0., 0., 0., .5*u + .1*sin(t/.1+(o.a*.03)+3.*u) ),g-g+18.), // * Ground ghosts
b = ivec4(u * o.a + 2e2
+ vec2(7,30)*t // * Move camera (x,y)
, o+=.1 ); // Increment layer
o =
//o.a < 8.1 ? .1+sin(t/.1)*vec4(b%32 & b.x%9 & b.z%9) : // * Blinking lights
o/80. - .02 * // * Distance fog
vec4(b%2) // * Building colors
+ .2*(o.a > 17. ? vec4( int(.5+sin(float(b.x/2 + b.y + 2*b.z))) & b.x & b.y & int(.5+sin(4.*o.a-3.4)) ) : g-g) // * Windows
+ (o.a > 50. ? g*vec4(.02,.1,1,0) : g-g) // * Ground ghosts
+ vec4(1, 0, 0, .06)*sin(g) // * Moving fog
+ .01*max(exp(fract(h * B - z + t+t) * -1e2) / z,0.) // * Rain
;
o *= vec4(0.6, 0, 0, 1.0);
fragColor = o;
} }