Skip to content

ShaderAnaglyph

The TextureAnaglyph node takes two input textures, usually a stereo pair, and merges them into a anaglyph texture

The TextureAnaglyph node can be either applied as a shader to a 3d object or a ViewPort node, or used as an explicit texture renderpass to create the anaglyph texture.

ShaderAnaglyph Node

Create Stereoscopic 3D for Red-Cyan Glasses

ShaderAnaglyph merges a stereo pair (left and right eye views) into a single anaglyph texture viewable with red-cyan 3D glasses. Combined with SceneCamera in stereo mode, you can create immersive 3D content for projection mapping, installations, or video output.

Reference

The following properties can be configured for this node:

Property Type Description
contrast - contrast between left and right
deghost - deghosting value
stereo - stereo texture spread
Inlet Type Description
properties properties properties | use message [set <propertyPath> <value(s)>] (without node/<nodeName> at the beginning) to set internal properties
texture texture texture left (left eye view)
texture texture texture right (right eye view)
Outlet Type Description
texture texture anaglyph texture (combined stereo output)

How Anaglyph Works

Stereo to Anaglyph Conversion

Anaglyph 3D encodes the left and right eye views into different color channels:

  • Left eye: Encoded in the red channel
  • Right eye: Encoded in the cyan (green + blue) channels

When viewed through red-cyan glasses, each eye sees only its corresponding image, creating the illusion of depth.

Stereo Pipeline Setup

Complete Stereo Rendering Workflow

To create anaglyph 3D content from a SPARCK scene:

  1. Create a SceneCamera and enable stereo mode
  2. Configure stereo parameters (spread and rotate) for comfortable viewing
  3. Create a SceneCapture linked to the stereo camera
  4. The SceneCapture outputs two textures (left and right)
  5. Create a ShaderAnaglyph node
  6. Connect SceneCapture's left texture to ShaderAnaglyph's first inlet
  7. Connect SceneCapture's right texture to ShaderAnaglyph's second inlet
  8. Use the anaglyph output for display or further processing

Quality Settings

Adjusting Stereo Quality

Property Effect Guidance
contrast Balance between left/right images Adjust if one eye dominates
deghost Reduces color bleeding between eyes Increase if you see "ghost" images
stereo Controls texture spread/separation Fine-tune depth perception

Start with default values and adjust based on your viewing setup and content.

Usage Modes

Two Ways to Use ShaderAnaglyph

As a texture processor:

  • Connect stereo textures to the inlets
  • Use the output texture in other nodes or for display

As a shader on objects:

  • Apply ShaderAnaglyph directly to a 3D object or ViewPort
  • The shader processes textures in place during rendering

Viewing Requirements

3D Glasses Required

Anaglyph output requires red-cyan 3D glasses for proper stereoscopic viewing:

  • Red lens over left eye
  • Cyan (blue-green) lens over right eye

Without glasses, the image appears as overlapping red and cyan outlines.



Need help or want to suggest improvements?

Report an issue Improve the Docs

Last updated: 2025-12-01 | Edit this page on GitHub