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;
26const
float PI = 3.14159265359;
36 float modValue = mod(value, length * 2.0);
37 return length - abs(modValue - length);
46 vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
47 vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
48 return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
60 float angle = atan(uv.y, uv.x) + time * 0.5;
61 float radius = length(uv);
62 uv = vec2(cos(angle), sin(angle)) * radius;
63 float ripple = sin(radius * 10.0 - time * 5.0) * 0.05;
64 uv +=
ripple * vec2(cos(angle), sin(angle));
65 vec3 texColor = texture(samp, uv * 0.5 + 0.5).rgb;
76 float offset = 0.005 * sin(
time_f);
77 vec3 finalColor = vec3(
82 color = vec4(finalColor, 1.0);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
vec3 ripple(ivec2 p, ivec2 size)
Evaluates ripple for this shader effect.
float pingPong(float x, float length)
Evaluates pingPong for this shader effect.
vec3 hsv2rgb(vec3 c)
Evaluates hsv2rgb for this shader effect.
vec3 vortexEffect(vec2 uv, float time)
Evaluates vortexEffect for this shader effect.