7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
17#define iResolution ext.u0.zw
18#define time_f ext.u2.y
21layout(location = 0) in vec2 tc;
22layout(set = 0, binding = 0) uniform sampler2D samp;
33 float m = mod(x, length * 2.0);
34 return m <= length ? m : length * 2.0 - m;
42float h1(
float n){
return fract(sin(
n)*43758.5453123); }
48vec2
h2(
float n){
return fract(sin(vec2(
n,
n+1.0))*vec2(43758.5453,22578.1459)); }
58 float w = a*a*(3.0-2.0*a);
59 vec2 p0 = vec2(0.15) +
h2(t0)*0.7;
60 vec2 p1 = vec2(0.15) +
h2(t0+1.0)*0.7;
61 vec2 center = mix(p0, p1, w);
65 float ang = atan(p.y, p.x);
72 float rp = r + bend * r * r;
74 vec2 uv = center + vec2(cos(ang), sin(ang)) * rp;
76 uv += 0.02 * vec2(sin((tc.y+
time_f)*4.0), cos((tc.x-
time_f)*3.5));
80 color = texture(samp, uv);
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.
vec2 h2(vec2 p)
Evaluates h2 for this shader effect.
float h1(float n)
Evaluates h1 for this shader effect.
vec2 swirl(vec2 uv, float centerRadius, float swirlAmount)
Evaluates swirl for this shader effect.
float n(vec2 p)
Evaluates n for this shader effect.
vec2 spin(vec2 p, float a)
Evaluates spin for this shader effect.