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;
32 return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);
44 float b =
random(i + vec2(1.0, 0.0));
45 float c =
random(i + vec2(0.0, 1.0));
46 float d =
random(i + vec2(1.0, 1.0));
47 vec2 u = f * f * (3.0 - 2.0 * f);
48 return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
58 float amplitude = 0.5;
60 for (
int i = 0; i < 5; i++) {
61 value += amplitude *
noise(st);
75 float modVal = mod(x, length * 2.0);
76 return modVal <= length ? modVal : length * 2.0 - modVal;
86 float dist = length(pos);
87 float angle = atan(pos.y, pos.x);
88 float lightning = smoothstep(0.1, 0.12,
fbm(vec2(angle * 8.0,
time_f * 0.5) + vec2(dist * 0.1)));
91 brightness = sin(brightness * time_z);
92 vec4 texColor = texture(samp, uv);
96 color = texColor + sin(vec4(vec3(brightness), 1.0) * time_t);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
float fbm(vec2 point)
Evaluates fbm for this shader effect.
float pingPong(float x, float length)
Evaluates pingPong for this shader effect.
float noise(vec2 p)
Evaluates noise for this shader effect.
float random(vec2 st)
Evaluates random for this shader effect.