Unigine supports "easy on the eye" stereo 3D rendering out-of-the box for all supported video cards. Unigine-powered 3D stereoscopic visualization provides the truly immersive experience even at the large field of view or across three monitors. It is a completely native solution for both DirectX and OpenGL APIs and does not require installing any special drivers. Depending on the set stereo mode, the only hardware requirements are the equipment necessary for stereoscopic viewing (for example, active shutter glasses, passive polarized or anaglyph ones) or a dedicated output device.

Notice

You may notice a drop in performance when using stereo rendering. This happens because all viewports are effectively rendered twice each frame.

There are several modes of stereo rendering available for Unigine-powered application. To enable them, no special steps or modifications are required. Just use a ready-compiled plugin library, set the desired start-up option and you application is stereo-ready!

This mode allows rendering Unigine-based application onto one monitor using NVIDIA 3D Vision technology.
3D Vision is available with both OpenGL and DirectX APIs because stereo rendering is performed by the Unigine-based application itself, though OpenGL stereo would be slower.
See further details on rendering below.

This mode allows rendering Unigine-based application across 3 monitors at the maximum frame rate using NVIDIA 3D Vision technology and multiple GPUs (Multi-GPU or SLI setup).
In this mode, it is possible to manually set up any custom configuration of rendering cameras. Each camera can be configured to use asymmetric view frustum or arbitrary field of view.
See further details on rendering below.

This mode serves to output two separate images for each of the eye. It can be used with any VR/AR output devices that support separate images output, e.g. for 3D video glasses or helmets (HMD). See further details on rendering below.

This mode uses the best of the native hardware support of 3D stereo in NVIDIA Quadro video cards which are capable of quad buffering.
Unigine utilizes it to gain a good performance. However, other NVIDIA cards also support this mode and show no lower level of performance.

Horizontal and Vertical stereo modes are supported for glass-free MasterImage 3D displays on mobile devices.
The same mode (a horizontal or a vertical one) is selected in the graphics chip driver settings.
See further details on rendering below.

To launch Horizontal stereo mode:

Specify the STEREO_HORIZONTAL definition on the start-up (together with other required CLI arguments).

Run the 32-bit or 64-bit application (or its debugging version).

Shell commands

main_x86 -extern_define STEREO_HORIZONTAL

Horizontal stereo mode for mobile devices

To launch Vertical stereo mode:

Specify the STEREO_VERTICAL definition on the start-up (together with other required CLI arguments).

The stereo rendering model uses asymmetric frustum parallel axis projection (called off-axis) to create optimal stereo pairs without vertical parallax (vertical shift towards the corners).
It means, two cameras with parallel lines of sight are created, one for each eye. They are separated horizontally relative the central position (this distance is called the eye separation distance and can be adjusted to avoid eyestrain from stereoscopic viewing). Both cameras use asymmetric frustum, when the far plane is parallel to the near plane, yet they are not symmetrical about the view axis. It enables to correctly align projection planes of two cameras to the zero parallax plane (i.e. the screen). Asymmetric frustum parallel axis projection produces no distortions in the corners making the stereoscopic image completely comfortable to the eye.

When rendered, objects that get in front of the camera's focal distance (that is, its projection plane) are perceived as popping out of the screen; objects that are behind it appear to be behind the screen and convey the impression of scene depth.

Unigine engine calculates the images for both eyes using the appropriate postprocess shader. Which shader is applied depends on the chosen stereo mode.

In case of 3D Vision mode, Unigine assigns the post_stereo_separate postprocess material to the player.
The shader initializes the creation of two render targets as an MRT (the left and right stereo pair) and the driver outputs them onto the monitor in the fullscreen mode.
The left and right eye images are presented on alternating frames and the active shutter glasses synchronized with the monitor refresh rate allow each eye to receive its own image.

3D Vision Surround mode is much the same as the basic 3D Vision, with the exception that stereo pairs are created for each of three monitors
(the post_stereo_separate postprocess material is assigned to all three viewports, or the post_stereo_replicate when rendering in the mono mode).

Anaglyph mode uses the post_stereo_anaglyph postprocess material and only one render target.
Two images are filtered by red and blue channels, superimposed and output onto the screen to be viewed through colored glasses.

Separate images mode uses the post_stereo_separate postprocess material.
It creates two render targets and outputs left and right eye images that are offset relative to each other onto the two separate monitors.

Oculus Rift mode uses the post_stereo_separate postprocess material.
Images for the left and right eyes are output onto the corresponding half of the screen and lenses of the Oculus Rift display distort them to make the eyes perceive this images the same way as in the real world.

In case of Quad Buffer mode, the post_stereo_separate postprocess material is used.

Interlaced lines mode uses the post_stereo_interlaced postprocess material.
This mode is based on the interlaced coding. For example, the image for the left eye can be displayed on the odd rows of pixels with one polarization and the image for the right eye - on the even rows with other polarization.

Horizontal and Vertical stereo modes use only one render target.
After that, the graphics chip driver handles it as two images aligned horizontally or vertically (depending on the set mode) and stretches them onto the screen to create a stereo effect.
If the horizontal stereo mode is used, the post_stereo_horizontal postprocess material is applied.
In case of the vertical stereo mode, the post_stereo_vertical postprocess material is used.

If stereo rendering is disabled (for example, when 3D Vision application is switched to the windowed mode),
post_stereo_replicate material is used and the postprocess shader creates a simple mono image (the same for all viewports, if there are many). This material allows to switch to normal rendering and avoid the black screen when the engine is not rendering stereo pairs.

Stereo rendering is optimized to be performance friendly while not compromising the visual quality. For example, shadow maps are only rendered once and used for both eyes; geometry culling is also performed only once. Most of the rendering passes are still doubled, that is why it might make sense to turn off unnecessary passes or set a global shader quality to lower level to minimise the performance drop.

Settings that allow adjusting stereo for comfortable viewing are found on the additional Stereo tab in the main menu. They are available for all stereo modes.

Distance

Distance to the screen. This is a distance in world space to the zero parallax plane, i.e. to the point where two views line up.

Notice

The higher the value, the further from the viewer the rendered scene is and the lesser stereo effect is.

Radius

Half of the eye separation distance. The eye separation distance is the distance of interaxial separation between the cameras used to create stereo pairs.

Notice

The higher the value, the stronger stereo effect is.

Offset

An offset after perspective projection.

Angle

This option is available only for 3D Vision Surround stereo mode.
It adjusts the viewing angle of two side viewports relative the central one.
This option allows to compensate for the turning angle of monitors when rendering the virtual world.

Bezel

This option is available only for 3D Vision Surround stereo mode.
It compensates bezel of the monitor.

Stereo script stereo.h (located in data/core/scripts/system folder). By default it is included in the system script unigine.cpp.
You can modify the stereo.h script in order to change the default camera configuration.

If you choose not to include the stereo script into the system one, you can set the appropriate stereo mode definition and control stereo parameters directly via engine.render.setStereoRadius() and engine.render.setStereoDistance() functions.
In this case, you need to implement your own camera configuration in therender() function of the system script:

Stereo Reprojection mode for VR enables to render 45 FPS as 90 FPS. Instead of rendering a picture for both eyes each frame, it is rendered for one of them, while the picture for the other is obtained by making reprojection of the rendered one, next time the picture is rendered for the second eye and reprojected for the first one, and so on. Two modes are available:

Reprojection does not give an x2 performance gain as there are a lot of other things to be rendered in addition to the ones rendered per-eye (such as shadow maps etc.). Moreover, in case of a CPU bottleneck, reprojection won't give any gain at all.

It is recommended to enable stereo reprojection in the following cases:

you have a stable 70-80 fps and just need some extra boost to get to 90

you have a fluctuating fps (like 90, then 45, and 90 again), in this case reprojection will help you to get stable 90

In case if your initial fps is below 45, reprojection will half the framerate, and you'll end up having a completely messed up image. In this case reprojection should be disabled.