Red/cyan stereo — depth faked from luminance.
GLSL fragment shader
The effect's own code. The uniforms and helpers above it — uTex, uFeedback, the depth proxy, the frame ring, depthAt(), timeAt() — are the same header every Ether-MOSH shader opens with, and are documented once on the registry rather than reprinted on all 143 pages.
void main(){ // Treat brightness as a depth map: bright things read as near, so they get // the widest parallax. Crude, but it separates convincingly in motion. float l = dot(texture2D(uTex, vUv).rgb, vec3(0.299, 0.587, 0.114)); // Parallax has to be a real fraction of the frame or the separation is // invisible; at 5% it measured as a no-op. // Depth needs a baseline separation as well as the luminance-proportional // part: with parallax purely proportional to brightness, mid-tones (most of // the frame) barely moved and the Depth axis read as dead. float par = ((l - 0.45) * 0.65 + 0.35) * uDepth * 0.15; vec3 left = texture2D(uTex, vUv + vec2(par, 0.0)).rgb; vec3 right = texture2D(uTex, vUv - vec2(par, 0.0)).rgb; // Push the channels apart rather than just swapping them, so the red/cyan // fringing reads the way real anaglyph does. vec3 stereo = vec3(left.r * 1.15, right.g * 0.95, right.b * 1.1); gl_FragColor = vec4(mix(texture2D(uTex, vUv).rgb, stereo, uAmount), texture2D(uTex, vUv).a); }