7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
18#define iResolution ext.u0.zw
19#define time_f ext.u2.y
22layout(location = 0) in vec2 tc;
23layout(set = 0, binding = 0) uniform sampler2D samp;
35 float modVal = mod(x, length * 2.0);
36 return modVal <= length ? modVal : length * 2.0 - modVal;
45 return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
56 vec2 u = f * f * (3.0 - 2.0 * f);
57 return mix(mix(
hash(i + vec2(0.0, 0.0)),
hash(i + vec2(1.0, 0.0)),
59 mix(
hash(i + vec2(0.0, 1.0)),
hash(i + vec2(1.0, 1.0)),
69 float radius = length(uv);
70 float angle = atan(uv.y, uv.x);
72 float radMod =
pingPong(radius + t * 0.3, 0.5);
73 float wave = sin(radius * 10.0 - t * 6.0) * 0.5 + 0.5;
74 float noiseEffect =
noise(uv * 10.0 + t * 0.5) * 0.2;
75 float r = sin(angle * 3.0 + radMod * 8.0 +
wave * 6.2831 +
77 float g = sin(angle * 4.0 - radMod * 6.0 +
wave * 4.1230 +
79 float b = sin(angle * 5.0 + radMod * 10.0 -
wave * 3.4560 -
81 float blur = exp(-radius * 10.0) * 0.8 + 0.2;
82 vec3 col = vec3(r, g, b) *
blur * 0.5 + 0.5;
83 vec3 texColor = texture(samp, tc + sin(t * 0.2 + radius) * 0.01).rgb;
84 col = mix(col, texColor, 0.4);
85 color = vec4(col,
alpha);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
vec3 wave(ivec2 p, ivec2 size)
Evaluates wave for this shader effect.
float pingPong(float x, float length)
Evaluates pingPong for this shader effect.
vec4 blur(sampler2D image, vec2 uv, vec2 resolution)
Evaluates blur for this shader effect.
float hash(vec2 p)
Evaluates hash for this shader effect.
float noise(vec2 p)
Evaluates noise for this shader effect.