7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
17#define amp_high ext.audio_bands.z
18#define amp_low ext.audio_bands.x
19#define amp_mid ext.audio_bands.y
20#define amp_peak ext.u2.w
21#define amp_smooth ext.u3.w
22#define iResolution ext.u0.zw
23#define time_f ext.u2.y
26layout(location = 0) out vec4 color;
27layout(set = 0, binding = 0) uniform sampler2D samp;
42 return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
50 vec2 i = floor(p), f = fract(p);
51 f = f * f * (3.0 - 2.0 * f);
61 float f = 0.0, a = 0.5;
62 for (
int i = 0; i < 6; ++i) {
64 p = mat2(0.8, -0.6, 0.6, 0.8) * p * 2.07 + 1.9;
75 return 1.0 - abs(mod(p, 2.0) - 1.0);
83 return 0.5 + 0.5 * cos(6.2831853 * (t + vec3(0.00, 0.34, 0.68)));
91 return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
101 float flow =
fbm(p * 2.2 + vec2(t * 0.12, -t * 0.2));
102 vec2 q = p + vec2(
fbm(p * 3.0 + t * 0.08),
fbm(p * 3.0 + 8.7 - t * 0.09)) * 0.45;
103 float hammer =
fbm(q * 6.0);
104 float channels = abs(sin(q.x * 8.0 + sin(q.y * 5.0 + t) * 2.0));
105 return flow * 0.65 + hammer * 0.28 - channels * 0.20 + sin(length(p) * 24.0 - t * 4.0) * 0.08;
115 vec2 g = vec2(
foundry(p + vec2(e, 0)) -
h,
foundry(p + vec2(0, e)) -
h) / e;
116 return normalize(vec3(-g * 0.2, 1));
127 vec3 v = normalize(vec3(-p * 0.1, 1.6));
128 vec3 l0 = normalize(vec3(-0.55, 0.72, 0.62)), l1 = normalize(vec3(0.8, -0.25, 0.55));
129 float nv = max(dot(
n, v), 0.0);
130 vec3 f0 = mix(vec3(0.48), base, 0.78);
131 vec3
F = f0 + (1.0 - f0) * pow(1.0 - nv, 5.0);
132 float sp0 = pow(max(dot(
n, normalize(v + l0)), 0.0), 110.0);
133 float sp1 = pow(max(dot(
n, normalize(v + l1)), 0.0), 32.0);
135 thinFilm(dot(reflect(-v,
n), vec3(0.43, 0.37, 0.2)) * 0.35 +
time_f * 0.018 + heat * 0.1);
136 return base * (0.06 + 0.18 * max(dot(
n, l0), 0.0)) +
137 F * (refl * 0.9 + sp0 * vec3(1, 0.7, 0.35) * 2.8 + sp1 * vec3(0.25, 0.5, 1.2));
144 vec2 p = (tc - 0.5) * vec2(aspect, 1.0);
149 float ca = 0.003 +
amp_high * 0.006;
150 vec3 src = vec3(texture(samp,
mirrorUV(uv +
n.xy * ca)).r, texture(samp, uv).g,
151 texture(samp,
mirrorUV(uv -
n.xy * ca)).b);
152 float y = dot(src, vec3(0.299, 0.587, 0.114));
153 vec3
alloy = mix(vec3(y) * vec3(0.9, 0.72, 0.5), src, 0.32);
154 float heat = smoothstep(0.42, 0.72,
fbm(p * 2.4 + vec2(0, -
time_f * 0.16)));
156 vec3 hot = mix(vec3(0.5, 0.015, 0.002), vec3(1.8, 0.65, 0.08), smoothstep(0.35, 0.8, heat));
157 float crack = pow(1.0 - abs(sin(
h * 10.0 +
time_f)), 14.0);
158 col += hot * heat * (0.25 + 0.65 *
amp_low) +
160 color = vec4(
aces(col * (1.0 +
amp_smooth * 0.25)), texture(samp, uv).a);
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.
vec2 mirrorUV(vec2 uv)
Evaluates mirrorUV for this shader effect.
float hash21(vec2 p)
Evaluates hash21 for this shader effect.
float h(vec2 p)
Evaluates h for this shader effect.
float n(vec2 p)
Evaluates n for this shader effect.
float F(vec2 p)
Evaluates F for this shader effect.
vec3 aces(vec3 x)
Evaluates aces for this shader effect.
float noise21(vec2 p)
Evaluates noise21 for this shader effect.
vec3 normalAt(vec2 p, float e, vec2 origin, float bass, float mid)
Evaluates normalAt for this shader effect.
vec3 thinFilm(float phase)
Evaluates thinFilm for this shader effect.