Advanced Anaglyph Stereo Techniques (r183)

Red-cyan stereoscopic demo using `AnaglyphEffect` with configurable depth presets to compare subtle, balanced, and deep parallax setups.

Key topics: three.js anaglyph, stereoscopic rendering, anaglyph effect, red cyan 3d, r183

What this code does

- AnaglyphEffect Pipeline: renders stereoscopic red/cyan output for classic 3D-glasses viewing.
- Depth Preset Comparison: subtle, balanced, and deep profiles scale scene parallax for comfort vs intensity tradeoffs.
- Mono Fallback: switch between mono and anaglyph to inspect depth cue differences instantly.
- Spatial Composition: tunnel rings and layered objects are distributed across depth for strong stereo readability.
- Practical Use: helps tune stereoscopic comfort before shipping camera or XR-adjacent visual experiments.

JavaScript Implementation

ES6+
import * as THREE from 'three'
import { AnaglyphEffect } from 'three/examples/jsm/effects/AnaglyphEffect.js'

const renderer = new THREE.WebGLRenderer({ antialias: true })
renderer.setSize(width, height)
const effect = new AnaglyphEffect(renderer)
effect.setSize(width, height)

function animate () {
  requestAnimationFrame(animate)
  effect.render(scene, camera) // red/cyan stereo output
}
animate()