#version 330 core
precision highp float;

// Fullscreen white noise (TV static). The fade is supplied by the demopart's keyframed `alpha`,
// alpha-blended over whatever is below. Deterministic per frame, so it is identical under --record.

uniform float iTime;
uniform float alpha;

in vec2 fragCoord; // pixel coordinates
out vec4 fragColor;

float hash(vec2 p) {
	return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
}

void main() {
	float frame = floor(iTime * 60.0); // integer frame index -> new static each frame, record-safe
	float n = hash(fragCoord + vec2(frame, frame * 1.7));
	fragColor = vec4(vec3(n), alpha);
}
