09 April 2009

osgViewer Command Reference

The utility osgViewer is the basic scene graph viewer distributed with OpenSceneGraph. Its primary purpose is as an example of how to write a simple viewer, but it is also functional enough to use as a basic 3D graphics viewer.

Usage: osgviewer [options] filename ...
Options:
--CullDrawThreadPerContext Select CullDrawThreadPerContext
threading model for viewer.
--CullThreadPerCameraDrawThreadPerContext Select
CullThreadPerCameraDrawThreadPerCo-
ntext threading model for viewer.
--DrawThreadPerContext Select DrawThreadPerContext
threading model for viewer.
--SingleThreaded Select SingleThreaded threading
model for viewer.
--accum-rgb Request a rgb accumulator buffer
visual
--accum-rgba Request a rgb accumulator buffer
visual
--cc Request use of compile contexts and
threads
--clear-color <color> Set the background color of the
viewer in the form "r,g,b[,a]".
--dem <filename> Load an image/DEM and render it on
a HeightField
--display <type> MONITOR | POWERWALL |
REALITY_CENTER |
HEAD_MOUNTED_DISPLAY
--help-all Display all command line, env vars
and keyboard & mouse bindings.
--help-env Display environmental variables
available
--help-keys Display keyboard & mouse bindings
available
--image <filename> Load an image and render it on a
quad
--login <url> <username> <password> Provide authentication information
for http file access.
--rgba Request a RGBA color buffer visual
--samples <num> Request a multisample visual
--screen <num> Set the screen to use when multiple
screens are present.
--serialize-draw <mode> OFF | ON - set the serialization of
draw dispatch
--stencil Request a stencil buffer visual
--stereo Use default stereo mode which is
ANAGLYPHIC if not overriden by
environmental variable
--stereo <mode> ANAGLYPHIC | QUAD_BUFFER |
HORIZONTAL_SPLIT | VERTICAL_SPLIT |
LEFT_EYE | RIGHT_EYE |
HORIZONTAL_INTERLACE |
VERTICAL_INTERLACE | CHECKERBOARD |
ON | OFF
--window <x y w h> Set the position (x,y) and size
(w,h) of the viewer window.
-O <option_string> Provide an option string to
reader/writers used to load
databases
-e <extension> Load the plugin associated with
handling files with specified
extension
-h or --help Display command line parameters
-l <library> Load the plugin


Environmental Variables:
OSG_BUILD_KDTREES on/off Enable/disable the
automatic building of
KdTrees for each loaded
Geometry.
OSG_COMPIlE_CONTEXTS <mode> OFF | ON Enable/disable
the use a backgrouind
compile contexts and
threads.
OSG_COMPUTE_NEAR_FAR_MODE <mode> DO_NOT_COMPUTE_NEAR_FAR |
COMPUTE_NEAR_FAR_USING_B-
OUNDING_VOLUMES |
COMPUTE_NEAR_FAR_USING_P-
RIMITIVES
OSG_CONFIG_FILE <filename> Specify a viewer
configuration file to
load by default.
OSG_DATABASE_PAGER_DRAWABLE <mode> Set the drawable policy
for setting of loaded
drawable to specified
type. mode can be one of
DoNotModify, DisplayList,
VBO or VertexArrays>.
OSG_DATABASE_PAGER_PRIORITY <mode> Set the thread priority
to DEFAULT, MIN, LOW,
NOMINAL, HIGH or MAX.
OSG_DEFAULT_BIN_SORT_MODE <type> SORT_BY_STATE |
SORT_BY_STATE_THEN_FRONT-
_TO_BACK |
SORT_FRONT_TO_BACK |
SORT_BACK_TO_FRONT
OSG_DISPLAY_TYPE <type> MONITOR | POWERWALL |
REALITY_CENTER |
HEAD_MOUNTED_DISPLAY
OSG_DO_PRE_COMPILE <ON/OFF> Switch on or off the pre
compile of OpenGL object
database pager.
OSG_EXPIRY_DELAY <float> Set the length of time a
PagedLOD child is kept in
memory, without being
used, before its tagged
as expired, and ear
marked to deletion.
OSG_EXPIRY_FRAMES <int> Set number of frames a
PagedLOD child is kept in
memory, without being
used, before its tagged
as expired, and ear
marked to deletion.
OSG_EYE_SEPARATION <float> physical distance between
eyes
OSG_FILE_PATH <path>[;path].. Paths for locating
datafiles
OSG_GL_ERROR_CHECKING <type> ONCE_PER_ATTRIBUTE | ON |
on enables fine grained
checking, ONCE_PER_FRAME
enables coarse grained
checking
OSG_LIBRARY_PATH <path>[;path].. Paths for locating
libraries/ plugins
OSG_MAXIMUM_OBJECTS_TO_COMPILE_PER_FRAME <int> maximum number of OpenGL
objects to compile per
frame in database pager.
OSG_MAX_NUMBER_OF_GRAPHICS_CONTEXTS <int> maximum number of
graphics contexts to be
used with applications.
OSG_MAX_PAGEDLOD <num> Set the target maximum
number of PagedLOD to
maintain.
OSG_MAX_TEXTURE_SIZE Set the maximum size of
textures.
OSG_MINIMUM_COMPILE_TIME_PER_FRAME <float> minimum compile time
alloted to compiling
OpenGL objects per frame
in database pager.
OSG_NEAR_FAR_RATIO <float> Set the ratio between
near and far planes -
must greater than 0.0 but
less than 1.0.
OSG_NUM_DATABASE_THREADS <int> Set the hint for the
total number of threads
to set up in the
DatabasePager.
OSG_NUM_HTTP_DATABASE_THREADS <int> Set the hint for the
total number of threads
dedicated to http
requests to set up in the
DatabasePager.
OSG_OPTIMIZER "<type> [<type>]" OFF | DEFAULT |
FLATTEN_STATIC_TRANSFORMS
|
FLATTEN_STATIC_TRANSFORM-
S_DUPLICATING_SHARED_SUB-
GRAPHS |
REMOVE_REDUNDANT_NODES |
COMBINE_ADJACENT_LODS |
SHARE_DUPLICATE_STATE |
MERGE_GEOMETRY |
MERGE_GEODES |
SPATIALIZE_GROUPS |
COPY_SHARED_NODES |
TRISTRIP_GEOMETRY |
OPTIMIZE_TEXTURE_SETTINGS
|
REMOVE_LOADED_PROXY_NODES
| TESSELLATE_GEOMETRY |
CHECK_GEOMETRY |
FLATTEN_BILLBOARDS |
TEXTURE_ATLAS_BUILDER |
STATIC_OBJECT_DETECTION
OSG_RELEASE_DELAY <float> Set the length of time a
PagedLOD child's OpenGL
objects are kept in
memory, without being
used, before be released
(setting to OFF disables
this feature.)
OSG_RELEASE_FRAMES <int> Set number of frames a
PagedLOD child's OpenGL
objects are kept in
memory, without being
used, before be released.
OSG_SCREEN <value> Set the default screen
that windows should open
up on.
OSG_SCREEN_DISTANCE <float> physical distance between
eyes and screen
OSG_SCREEN_HEIGHT <float> physical screen height
OSG_SCREEN_WIDTH <float> physical screen width
OSG_SERIALIZE_DRAW_DISPATCH <mode> OFF | ON Enable/disable
the use a muetx to
serialize the draw
dispatch when there are
multiple graphics
threads.
OSG_SPLIT_STEREO_AUTO_ADJUST_ASPECT_RATIO <mode> OFF | ON Default to ON
to compenstate for the
compression of the aspect
ratio when viewing in
split screen stereo.
Note, if you are setting
fovx and fovy explicityly
OFF should be used.
OSG_SPLIT_STEREO_HORIZONTAL_EYE_MAPPING <mode> LEFT_EYE_LEFT_VIEWPORT |
LEFT_EYE_RIGHT_VIEWPORT
OSG_SPLIT_STEREO_HORIZONTAL_SEPARATION <float> number of pixels between
viewports
OSG_SPLIT_STEREO_VERTICAL_EYE_MAPPING <mode> LEFT_EYE_TOP_VIEWPORT |
LEFT_EYE_BOTTOM_VIEWPORT
OSG_SPLIT_STEREO_VERTICAL_SEPARATION <float> number of pixels between
viewports
OSG_STEREO <mode> OFF | ON
OSG_STEREO_MODE <mode> QUAD_BUFFER | ANAGLYPHIC
| HORIZONTAL_SPLIT |
VERTICAL_SPLIT | LEFT_EYE
| RIGHT_EYE |
VERTICAL_INTERLACE |
HORIZONTAL_INTERLACE
OSG_TEXT_INCREMENTAL_SUBLOADING <type> ON | OFF
OSG_THREADING <value> Set the threading model
using by Viewer, <value>
can be SingleThreaded,
CullDrawThreadPerContext,
DrawThreadPerContext or
CullThreadPerCameraDrawT-
hreadPerContext.
OSG_THREAD_SAFE_REF_UNREF
OSG_WIN32_NV_MULTIMON_MULTITHREAD_WORKAROUND on/off Enable/disable duplicate
makeCurrentContext call
used as workaround for
WinXP/NVidia/MultiView/M-
ulitThread isues (pre
178.13 drivers).
OSG_WINDOW x y width height Set the default window
dimensions that windows
should open up on.
OSG_WRITE_OUT_DEFAULT_VALUES ON | OFF


1 comment:

mark underwood said...

With help from http://formatmysourcecode.blogspot.com/