// Halftone dots sized by brightness; dots turn hot orange wherever something moves. uniform float cell; // 4.0 .. 40.0 = 10.0 uniform float heat; // 0.0 .. 6.0 = 3.0 void main() { vec2 grid = resolution / cell; vec2 centre = (floor(uv * grid) + 0.5) / grid; vec3 c = texture(camera, centre).rgb; float luma = dot(c, vec3(0.299, 0.587, 0.114)); float radius = 0.5 * sqrt(luma); float dist = length(fract(uv * grid) - 0.5); float mask = 1.0 - smoothstep(radius - 0.05, radius + 0.05, dist); float moving = clamp(texture(motion, centre).r * heat, 0.0, 1.0); color = vec4(mix(c, vec3(1.0, 0.35, 0.1), moving) * mask, 1.0); }