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;
25const
float PI = 3.1415926535897932384626433832795;
34 float m = mod(x, length*2.0);
35 return m <= length ? m : length*2.0 - m;
44 vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);
45 vec3 p=abs(fract(c.xxx+K.xyz)*6.0-K.www);
46 return c.z*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),c.y);
53 vec2 uv = tc * 2.0 - 1.0;
55 float radius = mix(0.8, 1.2, 0.5 + 0.5 * sin(
time_f * 1.3));
58 float glow = smoothstep(radius, radius - 0.25, r) *
pingPong(
time_f, 5.0);
59 float ang = atan(uv.y, uv.x);
60 vec3 grad =
hsv2rgb(vec3(fract(ang / (2.0 *
PI) +
time_f * 0.05), 0.8, 1.0));
61 vec4 base = texture(samp, tc);
62 vec3 aura = grad * glow * (0.8 + 0.2 * sin(
time_f * 2.0));
63 color = vec4(base.rgb + aura * (1.0 - base.rgb), base.a);
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.
vec3 hsv2rgb(vec3 c)
Evaluates hsv2rgb for this shader effect.