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 iMouse ext.mouse
23#define iResolution ext.u0.zw
24#define time_f ext.u2.y
26layout(set = 0, binding = 0) uniform sampler2D samp;
39layout(location = 0) in vec2 tc;
57 t = clamp(t, 0.0, 1.0);
58 vec3 c1 = vec3(0.05, 0.0, 0.20);
59 vec3 c2 = vec3(0.85, 0.10, 0.55);
60 vec3 c3 = vec3(1.00, 0.55, 0.05);
61 vec3 c4 = vec3(0.40, 1.10, 0.30);
62 vec3 c5 = vec3(0.85, 1.20, 1.00);
63 if (t < 0.30)
return mix(c1, c2, t / 0.30);
64 if (t < 0.60)
return mix(c2, c3, (t - 0.30) / 0.30);
65 if (t < 0.85)
return mix(c3, c4, (t - 0.60) / 0.25);
66 return mix(c4, c5, (t - 0.85) / 0.15);
74vec2
wrapUV(vec2 v) {
return 1.0 - abs(1.0 - 2.0 * fract(v * 0.5)); }
82 vec2 ts = vec2(textureSize(tex, 0));
85 return textureLod(tex, clamp(u, eps, 1.0 - eps), 0.0);
92mat2
rot(
float a) {
float c = cos(a), s = sin(a);
return mat2(c, -s, s, c); }
100 p = fract(p * vec2(83.41, 27.93));
101 p += dot(p, p + 21.7);
102 return fract(p.x * p.y);
110 vec2 i = floor(p), f = fract(p);
112 float b =
hash21(i + vec2(1.0, 0.0));
113 float c =
hash21(i + vec2(0.0, 1.0));
114 float d =
hash21(i + vec2(1.0, 1.0));
115 vec2 u = f * f * (3.0 - 2.0 * f);
116 return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
124 float v = 0.0, a = 0.5;
125 for (
int i = 0; i < 6; ++i) { v += a *
vnoise(p); p *= 2.05; a *= 0.5; }
137 vec2 p = uv - center;
139 p /= 0.5 +
iZoom * 2.0;
142 vec2 q = vec2(
fbm(p + t * 0.2),
fbm(p + 5.2 - t * 0.17));
143 vec2 r = vec2(
fbm(p + 4.0 * q + 1.7 + t * 0.15),
144 fbm(p + 4.0 * q + 9.2 - t * 0.13));
145 float h =
fbm(p + 4.0 * r);
149 vec3 accTex = vec3(0.0);
152 for (
float i = 0.0; i < 4.0; i++) {
156 ring = min(ring, abs(length(pf) - 0.55));
157 vec2 texUV = pf * 0.5 + 0.5 + (r - 0.5) * 0.08;
158 accTex +=
mxTexture(samp, texUV).rgb / (i + 1.0);
161 float heat = clamp(
h * 1.4 + 0.25 *
iAmplitude, 0.0, 1.5);
163 vec3 col = mix(accTex * 0.7, flame, smoothstep(0.10, 0.95, heat));
164 col += flame * exp(-25.0 * ring) *
iContrast;
173 vec2 center = vec2(0.5);
183 float gray = dot(col, vec3(0.299, 0.587, 0.114));
186 col += vec3(0.6, 0.4, 1.0) * treble * 0.18;
189 vec2 vUV = uv * (1.0 - uv.yx);
190 float vig = pow(vUV.x * vUV.y * 15.0, 0.20);
193 color = vec4(col, 1.0);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
vec4 mxTexture(sampler2D tex, vec2 tc)
Evaluates mxTexture for this shader effect.
vec2 wrapUV(vec2 tc)
Evaluates wrapUV for this shader effect.
float fbm(vec2 point)
Evaluates fbm for this shader effect.
vec2 rot(vec2 v, float a)
Evaluates rot for this shader effect.
float vnoise(vec2 p)
Evaluates vnoise 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 beat(float t)
Evaluates beat for this shader effect.
vec3 plasmaFlame(vec2 uv, vec2 center, float t)
Evaluates plasmaFlame for this shader effect.
vec3 acidFlamePalette(float t)
Evaluates acidFlamePalette for this shader effect.