44 vec3 center = texture(samp, uv).rgb;
45 vec3
blur = texture(samp, clamp(uv + vec2(pixel.x, 0.0), 0.0, 1.0)).rgb;
46 blur += texture(samp, clamp(uv - vec2(pixel.x, 0.0), 0.0, 1.0)).rgb;
47 blur += texture(samp, clamp(uv + vec2(0.0, pixel.y), 0.0, 1.0)).rgb;
48 blur += texture(samp, clamp(uv - vec2(0.0, pixel.y), 0.0, 1.0)).rgb;
50 return clamp(center + (center -
blur) * 0.65, 0.0, 1.0);
59 float luma = dot(source, vec3(0.299, 0.587, 0.114));
60 float warmth = source.r - source.b;
61 float coolness = source.b - source.r;
64 graded.r += warmth * 0.18 + source.b * 0.08;
65 graded.g += coolness * 0.14;
66 graded.b += coolness * 0.24 + source.r * 0.04;
68 vec3 cyanShadow = vec3(0.015, 0.10, 0.14);
69 vec3 magentaLight = vec3(1.0, 0.16, 0.52);
70 float shadowMask = 1.0 - smoothstep(0.08, 0.48,
luma);
71 float highlightMask = smoothstep(0.48, 0.98,
luma);
72 graded = mix(graded, cyanShadow + graded * 0.58, shadowMask * 0.72);
73 graded = mix(graded, magentaLight + graded * 0.42, highlightMask * 0.34);
75 luma = dot(graded, vec3(0.299, 0.587, 0.114));
76 graded = mix(vec3(
luma), graded, 1.30);
77 graded = (graded - 0.5) * 1.20 + 0.5;
78 return clamp(graded, 0.0, 1.0);
87 float frame = floor(
time_f * 29.97);
90 float lineWobble = sin(uv.y * 170.0 +
time_f * 2.4) * pixel.x * 1.4;
91 float trackingNoise =
hash21(vec2(line, frame)) - 0.5;
92 float trackingBand = 1.0 - smoothstep(0.0, 0.035, abs(uv.y - fract(
time_f * 0.075)));
93 uv.x += lineWobble + trackingNoise * pixel.x * 0.7;
94 uv.x += trackingBand * trackingNoise * 0.055;
95 uv = clamp(uv, pixel, vec2(1.0) - pixel);
97 float chromaShift = pixel.x * 2.2 + trackingBand * 0.003;
99 source.r =
sampleSharp(clamp(uv + vec2(chromaShift, 0.0), 0.0, 1.0)).r;
100 source.b =
sampleSharp(clamp(uv - vec2(chromaShift * 1.35, 0.0), 0.0, 1.0)).b;
103 vec3 glow = texture(samp, clamp(uv + pixel * vec2(4.0, 2.0), 0.0, 1.0)).rgb;
104 glow += texture(samp, clamp(uv - pixel * vec2(4.0, 2.0), 0.0, 1.0)).rgb;
105 glow += texture(samp, clamp(uv + pixel * vec2(-4.0, 2.0), 0.0, 1.0)).rgb;
106 glow += texture(samp, clamp(uv + pixel * vec2(4.0, -2.0), 0.0, 1.0)).rgb;
109 image += max(glow - 0.64, 0.0) * vec3(0.85, 0.42, 1.10) * 0.48;
111 float scanline = 0.965 + 0.035 * sin(line * 3.14159265);
112 float grain =
hash21(gl_FragCoord.xy + frame * 17.0) - 0.5;
113 float flicker = 0.985 +
hash21(vec2(frame, 4.0)) * 0.015;
114 float vignette = 1.0 - smoothstep(0.22, 0.78, length((tc - 0.5) * vec2(1.08, 1.0)));
116 image += grain * (0.022 + trackingBand * 0.12);
117 image *= mix(0.80, 1.0, vignette);
119 color = vec4(clamp(image, 0.0, 1.0), 1.0);