7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
17#define iResolution ext.u0.zw
18#define random_seed ext.custom_uniforms[6].z
19#define time_f ext.u2.y
22layout(location = 0) out vec4 color;
23layout(set = 0, binding = 0) uniform sampler2D samp;
35 float r = abs(t * 6.0 - 3.0) - 1.0;
36 float g = 2.0 - abs(t * 6.0 - 2.0);
37 float b = 2.0 - abs(t * 6.0 - 4.0);
38 return clamp(vec3(r, g, b), 0.0, 1.0);
47 return texture(samp, p).r;
58 float radius = length(p);
59 float angle = atan(p.y, p.x) + sin(t + radius * 10.0 +
noise(p * 10.0 +
seed) * 10.0) * 0.5;
60 return vec2(cos(angle), sin(angle)) * radius;
67 float mod_time = mod(
time_f, 25.0);
68 vec2 uv = tc * 2.0 - 1.0;
74 float n =
noise(uv * 0.5 + mod_time * 0.05);
75 vec3 rainbow_color =
rainbow(
n + mod_time * 0.1);
77 vec4 original_color = texture(samp, tc);
78 vec3 blended_color = mix(original_color.rgb, rainbow_color, 0.5);
80 color = vec4(rainbow_color, 1.0);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
float noise(vec2 p)
Evaluates noise for this shader effect.
vec3 rainbow(float t)
Evaluates rainbow 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.