initial commit

This commit is contained in:
mr0xb 2026-07-13 15:10:55 -04:00
commit f1374f54c4
46 changed files with 4121 additions and 0 deletions

View file

@ -0,0 +1,170 @@
#define PI 3.141592653589793
float spotlightBeam(vec2 uv, vec2 origin, float angle, float width, float lengthFade) {
vec2 p = uv - origin;
float c = cos(angle);
float s = sin(angle);
// Rotate into beam space
vec2 q = vec2(
c * p.x + s * p.y,
-s * p.x + c * p.y
);
// Beam extends along +Y in local space
float across = abs(q.x);
float along = q.y;
float beamCore = exp(-pow(across / width, 2.0));
float beamLength = smoothstep(-0.05, 0.10, along) * (1.0 - smoothstep(lengthFade, 1.35, along));
return beamCore * beamLength;
}
float hash12(vec2 p) {
vec3 p3 = fract(vec3(p.xyx) * 0.1031);
p3 += dot(p3, p3.yzx + 33.33);
return fract((p3.x + p3.y) * p3.z);
}
float sparkleGrid(vec2 uv, float scale, float threshold, float speed) {
vec2 g = uv * vec2(scale, scale * 0.56);
vec2 id = floor(g);
vec2 f = fract(g) - 0.5;
float n = hash12(id);
float gate = step(threshold, n);
float twinkle = pow(max(0.0, sin(iTime * speed + n * 6.2831853)), 28.0);
float diamond = 1.0 - smoothstep(0.02, 0.13, abs(f.x) + abs(f.y));
float flareX = (1.0 - smoothstep(0.000, 0.016, abs(f.y))) *
(1.0 - smoothstep(0.000, 0.42, abs(f.x)));
float flareY = (1.0 - smoothstep(0.000, 0.016, abs(f.x))) *
(1.0 - smoothstep(0.000, 0.42, abs(f.y)));
return gate * twinkle * (diamond + 0.35 * flareX + 0.35 * flareY);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.xy;
vec2 px = 1.0 / iResolution.xy;
// Very light late-90s video wobble.
float wobble = sin(uv.y * 90.0 + iTime * 2.0) * 0.0008
+ sin(uv.y * 12.0 - iTime * 0.35) * 0.0010;
vec2 tUv = clamp(uv + vec2(wobble, 0.0), vec2(0.001), vec2(0.999));
// Tiny chromatic shift.
vec3 src;
src.r = texture(iChannel0, clamp(tUv + vec2(px.x * 1.1, 0.0), vec2(0.001), vec2(0.999))).r;
src.g = texture(iChannel0, tUv).g;
src.b = texture(iChannel0, clamp(tUv - vec2(px.x * 1.1, 0.0), vec2(0.001), vec2(0.999))).b;
float lum = dot(src, vec3(0.299, 0.587, 0.114));
float glyph = smoothstep(0.06, 0.30, lum);
// Velvet / leather background.
vec3 velvet = vec3(0.012, 0.007, 0.002);
vec3 brown = vec3(0.075, 0.038, 0.010);
vec3 bg = mix(velvet, brown, uv.y + 0.15 * sin(uv.x * 4.0 + iTime * 0.12));
// Cash Money gold.
vec3 gold = vec3(1.00, 0.62, 0.10);
vec3 paleGold = vec3(1.00, 0.88, 0.45);
vec3 hotGold = mix(gold, paleGold, pow(lum, 0.65));
// Tint glyphs gold while preserving some original terminal color.
vec3 col = mix(bg, src, glyph * 0.28);
col = mix(col, hotGold + src * 0.28, glyph * 0.82);
// Chrome sweep, like jewelry-store lights / spinning rims.
float sweep1 = pow(max(0.0, sin((uv.x * 1.8 + uv.y * 0.65) * PI * 2.0 - iTime * 0.55)), 22.0);
float sweep2 = pow(max(0.0, sin((uv.x * -1.1 + uv.y * 1.20) * PI * 2.0 + iTime * 0.40)), 30.0);
col += (sweep1 * 0.15 + sweep2 * 0.10) * vec3(1.0, 0.77, 0.32) * (0.35 + glyph);
// Independent moving spotlight trails
float ray1 = spotlightBeam(
uv,
vec2(0.10, 1.10),
-0.95 + 0.22 * sin(iTime * 0.63 + 0.3),
0.045 + 0.008 * sin(iTime * 1.10 + 0.7),
1.00
);
float ray2 = spotlightBeam(
uv,
vec2(0.35, 1.12),
-1.20 + 0.18 * sin(iTime * 0.47 + 1.7),
0.055 + 0.006 * sin(iTime * 0.90 + 2.1),
1.05
);
float ray3 = spotlightBeam(
uv,
vec2(0.72, 1.08),
-1.55 + 0.20 * sin(iTime * 0.71 + 2.8),
0.050 + 0.010 * sin(iTime * 1.30 + 0.5),
0.95
);
float ray4 = spotlightBeam(
uv,
vec2(0.92, 1.15),
-1.85 + 0.24 * sin(iTime * 0.58 + 4.0),
0.060 + 0.007 * sin(iTime * 0.80 + 3.4),
1.10
);
// Optional faint upward beam from bottom-left for extra motion
float ray5 = spotlightBeam(
uv,
vec2(-0.05, -0.05),
0.70 + 0.15 * sin(iTime * 0.52 + 5.2),
0.040 + 0.005 * sin(iTime * 1.00 + 1.3),
0.90
);
float rays = 0.0;
rays += ray1 * (0.75 + 0.25 * sin(iTime * 0.90 + 0.2));
rays += ray2 * (0.65 + 0.35 * sin(iTime * 0.70 + 1.9));
rays += ray3 * (0.80 + 0.20 * sin(iTime * 1.10 + 2.6));
rays += ray4 * (0.70 + 0.30 * sin(iTime * 0.85 + 4.3));
rays += ray5 * (0.45 + 0.25 * sin(iTime * 0.95 + 3.1));
// Warm gold spotlight tint
vec3 rayColorA = vec3(1.00, 0.74, 0.22);
vec3 rayColorB = vec3(1.00, 0.86, 0.48);
// Mix two shades so it feels less flat
vec3 spotlightColor = mix(rayColorA, rayColorB, 0.5 + 0.5 * sin(iTime * 0.33));
// Add trails mostly into background, not too hard on text
col += rays * spotlightColor * (0.10 + 0.10 * (1.0 - glyph));
// Diamond glints.
float spark = sparkleGrid(uv, 62.0, 0.978, 4.0);
spark += 0.50 * sparkleGrid(uv + vec2(0.13, -0.09), 38.0, 0.965, 3.0);
col += spark * vec3(1.0, 0.90, 0.55) * (0.8 + 0.5 * glyph);
// Gold frame around the terminal.
float edgeD = min(min(uv.x, 1.0 - uv.x), min(uv.y, 1.0 - uv.y));
float frame = 1.0 - smoothstep(0.000, 0.045, edgeD);
float frameWave = pow(0.5 + 0.5 * sin((uv.x + uv.y) * 90.0 - iTime * 1.8), 8.0);
col += frame * vec3(1.0, 0.72, 0.20) * (0.10 + 0.22 * frameWave);
// Scanline shimmer, not too heavy.
float scan = 0.965 + 0.035 * sin(fragCoord.y * PI);
col *= scan;
// Music-video vignette.
float vig = 1.0 - smoothstep(0.22, 0.82, distance(uv, vec2(0.5)));
col *= 0.78 + 0.22 * vig;
// Keep text readable.
col = mix(col, src, glyph * 0.16);
fragColor = vec4(clamp(col, 0.0, 1.0), 1.0);
}