Sandbox Stereo Usage and Manipulation

Overview

Ideally we would like to change nothing in order to ship CryENGINE 3 games in S3D. 99% of the time this will be the case, but below are some items that must change, and things that should be considered whenever making any new project.

The vast majority of these settings have recently been exposed to designers an artist through an interface in the CryENGINE 3 Sandbox.

It can be found under the display tab at the bottom in the sandbox rollup bar.

Stereo Rendering Methods (Stereo Mode)

  • Dual Rendering
    The scene is rendered twice for the left and right eye, using an asymmetric frustum (off-center projection). This is the preferred mode for PC and when quality is more important than performance
    Status: Fully implemented.
  • Post Stereo/ SSRS (Screen Space Re-Projection Stereo)
    The image for the second eye is extracted from the first eye by offsetting pixels based on the depth. This is the only mode affordable on consoles.
    Status: Fully implemented.

Stereo Output

DeviceDescriptionStatus
Generic DualheadThe left and right eye images are output to the two monitor ports of the graphics card. This mode works with expensive projectors.Implemented; tested with several projectors (including public presentation at Siggraph 09).
iZ3DUses dualhead device with a special shader to condition images for the two iZ3D panels layered on top of each other.Implemented and working. An improved combination algorithm (shader code) is available from iZ3D that is not yet integrated.
HDMI 1.4Standard for stereo on PS3. The framebuffer needs to have twice the height plus a 30 pixel gap between the top and bottom image.
Side-by-SideUses double-width framebuffer where the right eye image is in the second half. Required mainly for stereo on 360.Implemented and working
InterlacedOne line of the left eye is followed by on line of the right eye image. Required mainly for stereo on 360 and for Sandbox Stereo Preview.Implemented and working
Emulation ModeUpdate left and right eye RTs (so that they can be viewed with r_ShowRenderTarget) without outputting actual stereo. Important for debugging.
AnaglyphAnaglyph mode for debugging and production if no stereo hardware is available.Implemented and working
Combining Rendering Methods with Output Modes

Ideally all methods would work with all output devices. However, a naive implementation creates quite a large amount of permutations that need to be maintained. A different approach is to split the stereo image generation from the actual output conditioning. This will sacrifice some performance and memory in some cases, especially on consoles. (images need to be copied to left and right buffers first, although they could be written directly to the framebuffer). The best approach is to deliberately limit the possible combinations (e.g. no dual rendering at all on consoles).

The Future for Stereo Experience Improvements
  • Experiment with automatic adaption of convergence for close objects, similar to DOF.
  • Experiment with limiting parallax.
  • Check more tricks from the Sony GDC presentation.

Defining the variables for the CryENGINE3 Renderer

VariableDescriptionParametersDefault ValueAdditional Description
r_StereoModeSets stereo rendering mode."0": Off
"1": Dual rendering
"2": Post Stereo
0
r_StereoOutputSets stereo output. Output depends on the stereo monitor"0": No stereo output (emulation mode)
"1": Generic Dual Head
"2": IZ3D
"3": Above and Below (not supported)
"4": Side by Side
"5": Interlaced
"6": Anaglyph
0
r_StereoDeviceSets the stereo device (Only possible before App Start)"0": No stereo support
"1": Frame compatible formats (side by side, interlaced, anaglyphic)
"2": HDMI 1.4 (PS3 only)
"3": Stereo driver (PC only Nvidia or AMD)
"4": Dualhead (PC only, two projectors or iZ3D)
"100": Auto-detect device for platform
1
r_StereoEyeDistDistance between eyes used for stereo (interocular distance)-0.02
r_StereoScreenDistDistance to plane where stereo parallax converges to zero-0.25
r_PostStereoEnables post process stereo view.-0
g_StereoFrameworkEnableEnables a stereo debugging feature"1" Normal mode
"2" Debug enabled
1
g_StereoIronsightEyeDistanceWhen a weapon is in ironsight mode, adjusts the r_StereoEyeDist-0.0064
g_StereoIronsightWeaponDistanceWhen a weapon is in ironsight mode, adjusts the r_StereoScreenDist-0.375
r_StereoGammaAdjustment Additional adjustment to the graphics card gamma correction when stereo is enabled"0":Off0.12
r_StereoHudScreenDistControls the depth where the HUD sits in the display-0.5
r_StereoNearGeoScaleScale for near geometry (weapon) that gets pushed into the screen-0.65
r_ShowRenderTargetDisplays special render targets - for debug purposeThe descirption is too long, check in editor or look into Render.cpp0Set to 26 for Stereo left and right buffers
capture_misc_render_bufferCaptures internal render targets.0: Disable (default)
1: Capture HDR, depth, shadow mask and AO buffers along with final framebuffer
2: Capture stereo left and right buffers
0Enable capturing via "capture_frames 1"