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.10, 0.0, 0.0);
59 vec3 c2 = vec3(0.70, 0.10, 0.05);
60 vec3 c3 = vec3(1.20, 0.50, 0.10);
61 vec3 c4 = vec3(1.30, 1.00, 0.40);
62 if (t < 0.40)
return mix(c1, c2, t / 0.40);
63 if (t < 0.75)
return mix(c2, c3, (t - 0.40) / 0.35);
64 return mix(c3, c4, (t - 0.75) / 0.25);
72vec2
wrapUV(vec2 v) {
return 1.0 - abs(1.0 - 2.0 * fract(v * 0.5)); }
80 vec2 ts = vec2(textureSize(tex, 0));
83 return textureLod(tex, clamp(u, eps, 1.0 - eps), 0.0);
90mat2
rot(
float a) {
float c = cos(a), s = sin(a);
return mat2(c, -s, s, c); }
98 p = fract(p * vec2(127.1, 311.7));
99 p += dot(p, p + 19.31);
100 return fract(p.x * p.y);
111 vec2 p = uv - center;
113 p /= 0.5 +
iZoom * 2.0;
118 for (
float i = 0.0; i < 4.0; i++) {
122 vec2 texUV = pf * 0.5 + 0.5;
123 bg +=
mxTexture(samp, texUV).rgb * (0.5 / (i + 1.0));
128 float emberLight = 0.0;
129 vec3 emberCol = vec3(0.0);
131 vec2 gi = floor(grid);
132 vec2 gf = fract(grid) - 0.5;
133 for (
int dy = -1; dy <= 1; ++dy) {
134 for (
int dx = -1; dx <= 1; ++dx) {
135 vec2 nb = vec2(
float(dx),
float(dy));
138 float life = fract(
h * 13.7 + t * (0.30 + 0.40 *
h));
144 vec2 pos = nb + jitter * 0.6 + vec2(0.0, -life * 1.0);
145 float d = length(gf - pos);
148 float heat = mix(0.4, 1.0,
h) * (1.0 - life * 0.7);
154 bg =
mxTexture(samp, p * 0.4 + 0.5 + vec2(0.0, sin(p.x * 8.0 + t * 2.0) * 0.01)).rgb * 0.3 + bg;
156 vec3 col = bg * 0.5 + emberCol *
iContrast;
166 vec2 center = vec2(0.5);
176 float gray = dot(col, vec3(0.299, 0.587, 0.114));
179 col += vec3(0.6, 0.4, 1.0) * treble * 0.18;
182 vec2 vUV = uv * (1.0 - uv.yx);
183 float vig = pow(vUV.x * vUV.y * 15.0, 0.20);
186 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.
vec2 rot(vec2 v, float a)
Evaluates rot for this shader effect.
float hash21(vec2 p)
Evaluates hash21 for this shader effect.
float h(vec2 p)
Evaluates h for this shader effect.
vec2 cell(vec2 p)
Evaluates cell for this shader effect.
float beat(float t)
Evaluates beat for this shader effect.
vec3 firePalette(float t)
Evaluates firePalette for this shader effect.
const float iEmberDensity
vec3 emberStorm(vec2 uv, vec2 center, float t)
Evaluates emberStorm for this shader effect.