Capítulo 374 de 859

Chapter 374: AnaglyphPassNode

Core Idea

A render pass node that creates an anaglyph effect using physically-correct off-axis stereo projection.

This implementation uses CameraUtils.frameCorners() to align stereo camera frustums to a virtual screen plane, providing accurate depth perception with zero parallax at the plane distance.

Key Concepts

  • algorithm : string: Gets the current anaglyph algorithm.
  • algorithm : string: Sets the anaglyph algorithm.
  • colorMode : string: Gets the current color mode.
  • colorMode : string: Sets the color mode.
  • eyeSep : number: The interpupillary distance (eye separation) in world units. Typical human IPD is 0.064 meters (64mm).
  • isAnaglyphPassNode : boolean (readonly): This flag can be used for type testing.
  • planeDistance : number: The distance in world units from the viewer to the virtual screen plane where zero parallax (screen depth) occurs. Objects at this distance…

Code Examples

import { anaglyphPass, AnaglyphAlgorithm, AnaglyphColorMode } from 'three/addons/tsl/display/AnaglyphPassNode.js';
  • What it demonstrates: Typical usage of AnaglyphPassNode.

Reference Tables

Constructor

Signature
new AnaglyphPassNode( scene : Scene, camera : Camera )

Properties

PropertyDescription
.algorithm : stringGets the current anaglyph algorithm.
.algorithm : stringSets the anaglyph algorithm.
.colorMode : stringGets the current color mode.
.colorMode : stringSets the color mode.
.eyeSep : numberThe interpupillary distance (eye separation) in world units. Typical human IPD is 0.064 meters (64mm).
.isAnaglyphPassNode : boolean (readonly)This flag can be used for type testing.
.planeDistance : numberThe distance in world units from the viewer to the virtual screen plane where zero parallax (screen depth) occurs. Objects at this distance appear at the screen surface. Objects closer appear in fron…

Methods

MethodDescription
.setup( builder : NodeBuilder ) : PassTextureNodeThis method is used to setup the effect's TSL code.
.updateStereoCamera( coordinateSystem : number )Updates the internal stereo camera using frameCorners for physically-correct off-axis projection.

Key Takeaways

  1. AnaglyphPassNode extends: EventDispatcher → Node → TempNode → PassNode → StereoCompositePassNode
  2. Most relevant properties: algorithm, algorithm, colorMode, colorMode.
  3. Key methods: setup, updateStereoCamera.

Connects To