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) out vec4 color;
23layout(set = 0, binding = 0) uniform sampler2D samp;
33 return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
46 for (
int y=-1; y<=1; y++) {
47 for (
int x=-1; x<=1; x++) {
51 float d = length(diff);
65 float cracks = smoothstep(0.05, 0.15,
voronoi(uv * (2.0 + 0.5*sin(
time_f*0.1))));
68 vec2 offset = vec2(cos(uv.y*20.0 +
time_f*0.5), sin(uv.x*20.0 -
time_f*0.5))
69 * (1.0 - cracks) * 0.02;
72 vec4 texCol = texture(samp, tc + offset);
75 vec3 crackColor = mix(vec3(0.0), texCol.rgb, cracks);
77 color = vec4(crackColor, 1.0);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
float hash(vec2 p)
Evaluates hash for this shader effect.
vec2 voronoi(vec2 p)
Evaluates voronoi for this shader effect.
float lattice(vec2 point, float bass, float middle, float high)
Evaluates lattice for this shader effect.