// Full-viewport decorative layers over the 3D scene: halftone dots and the
// CRT/old-TV treatment (scanlines + boiling static + vignette). Stacked at
// z 2-5: above the canvas, below the HUD (z 10), the BIOS screen (z 20)
// and the title overlay (z 30) - the interface stays crisp and only the
// scene gets the old-TV treatment.
//
// Performance: the only animation is a transform-only jitter on the noise
// layer, so everything stays on the compositor and never repaints the
// WebGL canvas underneath.
import Box from "@mui/material/Box";
import { keyframes } from "@mui/material/styles";
const crtNoise = keyframes`
0% { transform: translate(0, 0); }
25% { transform: translate(-45px, 30px); }
50% { transform: translate(25px, -55px); }
75% { transform: translate(-30px, -15px); }
100% { transform: translate(0, 0); }
`;
const NOISE_SVG =
"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E\")";
export function Halftone() {
return (
);
}
export function CrtOverlay() {
const scanlineOpacity = 0.13;
const scanlinePitch = "3px";
const noiseOpacity = 0.045;
const vignetteOpacity = 0.42;
return (
{/* SCANLINES: one thin dark line every pitch, plus a very faint
vertical RGB fringe (aperture-grille tint). Static. */}
{/* NOISE: tiled SVG turbulence, jittered between four offsets with
steps() so the grain "boils" like broadcast static. */}
{/* VIGNETTE: gently darkened corners, like curved CRT glass. */}
);
}