7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
17#define time_f ext.u2.y
20layout(location = 0) out vec4 color;
21layout(set = 0, binding = 0) uniform sampler2D samp;
30 return 1.0 - abs(mod(p, 2.0) - 1.0);
40 float h = sin(dot(p, vec2(13.0, 9.0)) + t * 1.7);
41 h += 0.55 * sin(dot(p, vec2(-8.0, 17.0)) - t * 1.25);
42 h += 0.28 * sin(dot(p, vec2(25.0, 6.0)) + t * 2.1);
54 vec2 uv =
safeUV(tc +
n * 0.0018);
55 vec4 src = texture(samp, uv);
56 float caustic = pow(max(0.0, 1.0 - length(
n) * 0.055), 7.0);
57 vec3 lit = src.rgb * (0.94 + 0.20 *
caustic);
58 lit += vec3(0.03, 0.11, 0.14) *
caustic;
59 color = vec4(lit, texture(samp, tc).a);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
float h(vec2 p)
Evaluates h for this shader effect.
float n(vec2 p)
Evaluates n for this shader effect.
vec2 safeUV(vec2 p)
Evaluates safeUV for this shader effect.
float surface(vec2 p, float t)
Evaluates surface for this shader effect.
float caustic(vec2 p)
Evaluates caustic for this shader effect.