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,96 @@
#define PI 3.141592653589793
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 diamondSparkle(vec2 uv, float density, float threshold, float speed) {
vec2 g = uv * vec2(density, density * 0.55);
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)), 36.0);
float diaD = abs(f.x) + abs(f.y);
float diamond = 1.0 - smoothstep(0.00, 0.10, diaD);
float vertical = (1.0 - smoothstep(0.00, 0.012, abs(f.x))) *
(1.0 - smoothstep(0.00, 0.38, abs(f.y)));
float horizontal = (1.0 - smoothstep(0.00, 0.012, abs(f.y))) *
(1.0 - smoothstep(0.00, 0.38, abs(f.x)));
return gate * twinkle * (diamond + 0.40 * (vertical + horizontal));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.xy;
vec2 px = 1.0 / iResolution.xy;
// Tiny VHS-ish horizontal wobble.
float wobble = sin(uv.y * 82.0 + iTime * 2.1) * 0.0008
+ sin(uv.y * 11.0 - iTime * 0.35) * 0.0012;
vec2 uvR = clamp(uv + vec2(wobble + px.x * 1.25, 0.0), vec2(0.001), vec2(0.999));
vec2 uvG = clamp(uv + vec2(wobble, 0.0), vec2(0.001), vec2(0.999));
vec2 uvB = clamp(uv + vec2(wobble - px.x * 1.25, 0.0), vec2(0.001), vec2(0.999));
vec4 base = texture(iChannel0, uvG);
vec3 src = vec3(
texture(iChannel0, uvR).r,
base.g,
texture(iChannel0, uvB).b
);
float lum = dot(src, vec3(0.299, 0.587, 0.114));
float ink = smoothstep(0.03, 0.22, lum);
float text = smoothstep(0.20, 0.78, lum);
// Cash-money palette: velvet black, dark leather brown, hot gold, pale diamond gold.
vec3 velvet = vec3(0.014, 0.008, 0.003);
vec3 brown = vec3(0.085, 0.044, 0.012);
vec3 gold = vec3(1.00, 0.66, 0.13);
vec3 paleGold = vec3(1.00, 0.90, 0.55);
vec3 bg = mix(
velvet,
brown,
uv.y + 0.20 * sin(uv.x * 3.0 + iTime * 0.10)
);
vec3 goldText = mix(gold * 0.75, paleGold, pow(lum, 0.75));
vec3 col = mix(bg, mix(src, goldText + src * 0.50, 0.48), ink);
// Jewelry-store light sweep / chrome-grille reflection.
float sweepA = pow(max(0.0, sin((uv.x * 1.8 + uv.y * 0.75) * PI * 2.0 - iTime * 0.60)), 22.0);
float sweepB = pow(max(0.0, sin((uv.x * -1.1 + uv.y * 1.25) * PI * 2.0 + iTime * 0.42)), 30.0);
col += (sweepA * 0.16 + sweepB * 0.11) * vec3(1.0, 0.83, 0.42) * (0.35 + text);
// Thin old-video scan shimmer, subtle enough to keep text readable.
float scan = 0.965 + 0.035 * sin(fragCoord.y * PI);
float vhs = 0.98 + 0.02 * hash12(vec2(floor(uv.y * 360.0), floor(iTime * 24.0)));
col *= scan * vhs;
// Random diamond/star hits.
float spark = diamondSparkle(uv, 74.0, 0.978, 4.5);
spark += 0.55 * diamondSparkle(uv + vec2(0.17, -0.11), 43.0, 0.970, 3.2);
col += spark * vec3(1.0, 0.88, 0.48) * (0.85 + 0.65 * text);
// Camera-flash blobs in the corners.
vec2 aspect = vec2(iResolution.x / iResolution.y, 1.0);
float flashL = 1.0 - smoothstep(0.00, 0.28, length((uv - vec2(0.14, 0.82)) * aspect));
float flashR = 1.0 - smoothstep(0.00, 0.34, length((uv - vec2(0.88, 0.18)) * aspect));
col += (flashL * 0.10 + flashR * 0.07) * vec3(1.0, 0.72, 0.22);
// Music-video edge falloff.
float vig = 1.0 - smoothstep(0.20, 0.82, distance(uv, vec2(0.5)));
col *= 0.80 + 0.20 * vig;
// Legibility save: blend some original terminal text back in.
col = mix(col, src, 0.18 * text);
fragColor = vec4(clamp(col, 0.0, 1.0), base.a);
}