7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
18#define iMouse ext.mouse
19#define iResolution ext.u0.zw
20#define time_f ext.u2.y
24layout(location = 0) out vec4 color;
26layout(set = 0, binding = 0) uniform sampler2D samp;
33const
float PI = 3.1415926535897932384626433832795;
42 float m = mod(x, length * 2.0);
43 return m <= length ? m : length * 2.0 - m;
52float sat(
float x){
return clamp(x,0.0,1.0);}
60 float v = 0.4 +
amp*0.2;
63 float base = mod(
time_f*v, s);
64 vec2 dir = normalize(uv - m + 1e-6);
65 float r = distance(uv, m);
69 float rc = base + float(k)*s;
70 float a = (r - rc)/width;
76 vec2 duv = dir * sin(
pingPong(waveSum *
PI, 5.0)) * (0.015 + 0.015*
uamp);
77 vec4 tex = texture(samp, uv + duv);
79 float blend =
sat(waveSum * (0.45 + 0.55*
uamp));
80 vec3 blue = mix(tex.rgb, vec3(0.06, 0.28, 1.0), blend);
81 color = vec4(blue, 1.0);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
float pingPong(float x, float length)
Evaluates pingPong for this shader effect.
float sat(float x)
Evaluates sat for this shader effect.