Almost all OSG applications have the potential for stereo support simply by setting the relevent environmental variables, or via command line arguments. Little or no code changes will be required, the support is handled transparently inside osgUtil::SceneView's handling of rendering.
If the user is planning to use head tracked stereo, or a cave then it
is currently recommend to set it up via a VR toolkit such as VRjuggler,
in this case refer to the VR toolkits handling of stereo, and do not invoke
the OSG's native support, i.e. keep all the OSG's stereo specific environment
varibles (below) set to OFF, or set the values to off within own your own
applications.
| OSG_STEREO | ON | turn stereo on. |
| OSG_STEREO | OFF | turn stereo off (default) |
| OSG_STEREO_MODE | ANAGLYPHIC | use anaglyphic stereo when in stereo (default). |
| OSG_STEREO_MODE | QUAD_BUFFER | use quad buffered stereo when in stereo. |
| OSG_SCREEN_DISTANCE | 0.50 | set the distance the viewer is from screen in metres (default shown) |
| OSG_SCREEN_HEIGHT | 0.26 | set the height if image on the screen in metres (default shown) |
| OSG_EYE_SEPERATION | 0.05 | set the eye seperation - interoccular distance (default shown.) |
| -stereo | Switch on stereo. | |
| -stereo | ON | Switch on stereo. |
| -stereo | OFF | Switch off stereo. |
| -stereo | ANAGLYPHIC | Switch on ANAGLYPHIC stereo. |
| -stereo | QUAD_BUFFER | Switch on QUAD_BUFFER stereo. |
To invoke quad buffered stereo from the commandline:
sgv -stereo QUAD_BUFFER cow.osg
To force all apps to start up in quad buffered stereo (if system supports
it)
export OSG_STEREO=ON
export OSG_STEREO_MODE=QUAD_BUFFER
sgv cow.osg
To set quad buffered stereo to the default, but use the commandline
to switch stereo on:
export OSG_STEREO=OFF
export OSG_STEREO_MODE=QUAD_BUFFER
sgv -stereo cow.osg