SoDirectVizManager Class Reference
[DirectViz]

DirectViz Manages ray-traced rendering. More...

#include <DirectViz/SoDirectVizManager.h>

Inheritance diagram for SoDirectVizManager:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Types

enum  CacheMode {
  READ_WRITE_MODE,
  READ_MODE,
  WRITE_MODE
}
enum  EnvLights {
  ENV_LIGHTS_0,
  ENV_LIGHTS_2,
  ENV_LIGHTS_4,
  ENV_LIGHTS_8,
  ENV_LIGHTS_16,
  ENV_LIGHTS_32,
  ENV_LIGHTS_64,
  ENV_LIGHTS_128,
  ENV_LIGHTS_256
}

Public Member Functions

virtual SoType getTypeId () const
 ~SoDirectVizManager ()
int getCurrentAccumValue () const
void getRenderedImageSize (SbVec2s &size) const
double getLastRenderTime () const
void setCacheDirectory (SbString directory)
void setCacheFile (SbString file, CacheMode mode=READ_WRITE_MODE)
int getNumEnvironmentLights ()
void setCamera (SoCamera *camera)

Static Public Member Functions

static SoType getClassTypeId ()
static void init ()
static void finish ()
static bool isInitialized ()
static SoDirectVizManagergetInstance (SoSceneManager *mgr)

Public Attributes

SoSFBool accumulation
SoSFInt32 maxAccumulationValue
SoSFBool subSampling
SoSFFloat subSamplingFactor
SoSFInt32 recursionLimit
SoSFBool subRecursion
SoSFBool progressiveRendering
SoSFInt32 numProgressiveRenderingSteps
SoSFBool rendering
SoSFBool globalShadowing
SoSFBool adaptiveOversampling
SoSFBool softShadows
SoSFBool fuzzyLights
SoSFBool glossySurfaces
SoSFEnum numEnvLights
SoSFFloat envLightIntensityScale
SoSFBool fileCaching
SoSFBool controlDialog

Friends

class SoDirectVizCacheManager
class SoDirectVizRenderAction
class SoDirectVizRenderManager

Detailed Description

DirectViz Manages ray-traced rendering.

SoDirectVizManager manages ray-traced rendering of scenes. See DirectViz group for the package description.

SoDirectVizManager derives from SoNode, however it must not be referenced by the application and must not be inserted in a scene graph. SoDirectVizManager is freed by calling finish().

SoDirectVizManager provides general control of DirectViz:

Note: reflection and shadow rays computation use an offset internally used to deflect ray in order to prevent infinite hits. This offset is properly initialized to 1e-3, but it may lead to artefacts in some cases (wrong pixels). Then, the SoPreference variable DIRECTVIZ_RAY_EPSILON will have to be set to 1e-2 or 1e-1.

SEE ALSO

SoSceneManager, SoXtRenderArea, SoXtViewer, SoWinRenderArea, SoWinViewer, SoQtRenderArea, SoQtViewer, SoSeparator, SoDirectVizShader

Deprecated:

Deprecated since Open Inventor 9500
No longer supported.
See related examples:

DirectVizAlphaMap, DirectVizPhong, DirectVizDiffuse, DirectVizPhongEyeLight, DirectVizBumpMap, DirectVizBumpMapGlass, DirectVizDofCamera, DirectVizEnvLighting, DirectVizFresnel, DirectVizFuzzyPhong, DirectVizGlossyPhong, DirectVizGlass, DirectVizGlossyGlass, DirectVizShadowEnv, DirectVizSoftShadows, DirectVizSpotLight, DirectVizWallThickness, HelloIceCube, IceCubeExaminer, IceCubeOffscreen


Member Enumeration Documentation

Cache states.

Enumerator:
READ_WRITE_MODE 

cache enabled in reading and writing

READ_MODE 

cache enabled only in reading

WRITE_MODE 

cache enabled only in writing

Number of environment lights.

Enumerator:
ENV_LIGHTS_0 

0 lights

ENV_LIGHTS_2 

2 lights

ENV_LIGHTS_4 

4 lights

ENV_LIGHTS_8 

8 lights

ENV_LIGHTS_16 

16 lights

ENV_LIGHTS_32 

32 lights

ENV_LIGHTS_64 

64 lights

ENV_LIGHTS_128 

128 lights

ENV_LIGHTS_256 

256 lights


Constructor & Destructor Documentation

SoDirectVizManager::~SoDirectVizManager (  ) 

Destructor.


Member Function Documentation

static void SoDirectVizManager::finish (  )  [static]

Shuts down the DirectViz module, which includes freeing any internal static memory that it allocated.

Finish methods must be called in the reverse order of the init method calls:

static SoType SoDirectVizManager::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoNode.

int SoDirectVizManager::getCurrentAccumValue (  )  const

Gets the current accumulation value.

static SoDirectVizManager* SoDirectVizManager::getInstance ( SoSceneManager mgr  )  [static]

Returns a pointer to a DirectVizManager object associated with the specified scene manager.


If DirectViz was already associated with a scene manager, calling getInstance() with another scene manager will deactivate DirectViz on the previously associated scene manager. To retrieve the scene manager corresponding to a viewer or render area, you can use code similar to:

       pViewer->getSceneManager();
double SoDirectVizManager::getLastRenderTime (  )  const

Gets the elapsed time for rendering the last frame in seconds.

int SoDirectVizManager::getNumEnvironmentLights (  ) 

Returns number of environment lights (see field numEnvLights).

void SoDirectVizManager::getRenderedImageSize ( SbVec2s size  )  const

Gets the size of rendered image in pixels.

virtual SoType SoDirectVizManager::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

static void SoDirectVizManager::init (  )  [static]

Initalizes the DirectViz classes.


It is not necessary to call this method directly from a user application as DirectViz will be initialized automatically by Open Inventor.

static bool SoDirectVizManager::isInitialized (  )  [static]

Returns TRUE if DirectViz is currently initialized.

void SoDirectVizManager::setCacheDirectory ( SbString  directory  ) 

Specifies cache directory (it must be an absolute path).


The initial value can be set using the environment variable DIRECTVIZ_CACHE_DIR. See SoPreferences.

void SoDirectVizManager::setCacheFile ( SbString  file,
CacheMode  mode = READ_WRITE_MODE 
)

Specifies cache file as an absolute path name.


Cache files can be used for either reading or writing depending on mode:

  • READ_WRITE_MODE (default): the file is used for both reading and writing.
  • READ_MODE: the file is only used for reading. The file will not be erased when a cache is written.
  • WRITE_MODE: the file is only used for writing.
void SoDirectVizManager::setCamera ( SoCamera camera  ) 

Set the camera to use for rendering.

This method should only be called when using DirectViz rendering outside of a standard Open Inventor viewer based on SoGuiViewer (e.g. custom viewer usage).

Since Open Inventor 9.3


Friends And Related Function Documentation

friend class SoDirectVizCacheManager [friend]
friend class SoDirectVizRenderAction [friend]
friend class SoDirectVizRenderManager [friend]

Member Data Documentation

Activates/deactivates accumulation passes.


Accumulation consists of successive rendering passes resulting in progressive oversampling of the rendered image, reducing aliasing. Accumulation passes are started only after a small delay without rendering, i.e. when the viewer is still and there is no animation in the scene. Each rendering pass takes a time equivalent to render a full resolution image. Accumulation is stopped after the current rendering pass is completed as soon as interaction starts again. Default is TRUE.

The initial value can be set using the environment variable DIRECTVIZ _ACCUMULATION. See SoPreferences. The number of successive passes is controlled with the maxAccumulationValue field.

Enables/disables adaptive oversampling rendering.


Default is FALSE.

Adaptive oversampling reduces aliasing only near aliased pixels in the image. The initial value can be set using the environment variable DIRECTVIZ_ADAPTIVE_OVERSAMPLING. See SoPreferences. Since Open Inventor 7.2

Enables/disables the DirectViz control dialog.


DirectViz interactive parameters can be controlled using this dialog with Qt or Win32 viewers. When set to TRUE, the dialog can be displayed by pressing the Shift + F8 key (or the key specified in the DIRECTVIZ_DIALOG_SHORTCUT environment variable) Default is TRUE.

The initial value can be set using the environment variable DIRECTVIZ_CONTROL_DIALOG. See SoPreferences.

Intensity scale applied to environment lights defined by numEnvLights.


Default is 1.

The initial value can be set using the environment variable DIRECTVIZ_ENV_LIGHTS_SCALE. See SoPreferences. Since Open Inventor 8.0

Enables/disables acceleration structure cache file.


DirectViz file caching consists of saving on disk the internal accelaration structure built for OpenRTRT objects corresponding to an Open Inventor scene graph, which can save a significant amount of time when reloading large scenes.
A cache directory must be specified with the setCacheDirectory method, which will contain the cache files. For each scene graph there is exactly one cache file. A signature is automatically created and written in cache files, so it is not nesessary to name explicitly cached files.
If fileCaching is set to TRUE, before rendering a new scene, DirectViz will first search in the cache directory if there is a cache file correponding to the scene signature. If such cache file exists, DirectViz will directly load OpenRTRT objects from it. Otherwise, DirectViz will create OpenRTRT objects from the scene graph and save them with the scene signature in a new cache file in the cache directory. A cache file can also be specified explicitly with setCacheFile(). Default is FALSE.

The initial value can be set using the environment variable DIRECTVIZ_FILE_CACHING. See SoPreferences.

Enables/disables fuzzy effects globally in the scene graph.


Default is FALSE.

The initial value can be set using the environment variable DIRECTVIZ_FUZZY_LIGHTS. See SoPreferences. Since Open Inventor 7.2

Enables/disables shadows globally in the scene graph.


Default is FALSE.

The initial value can be set using the environment variable DIRECTVIZ_GLOBAL_SHADOW. See SoPreferences.

Enables/disables glossy surfaces effects globally in the scene graph.


Default is FALSE.

The initial value can be set using the environment variable DIRECTVIZ_GLOSSY_SURFACES. See SoPreferences. Since Open Inventor 7.2

Specifies a maximum number of accumulation passes.


Must be greater than or equal to 1. Default is 10.

The initial value can be set using the environment variable DIRECTVIZ_MAX_ACCUMULATION_VALUE. See SoPreferences.

Enables/disables environment lighting by specifying the number of lights.


When an Environment shader is specified, DirectViz allows extracting fake lights from the environment texture. Thus, the lighting is performed with additional lights coming directly from the environment. When combined with accumulation, the fake lights are taken at different environment texture positions at each accumulation step. Thus, lights from the entire environment can be used for illumination, giving a fast and accurate approximation of ambient occlusion. Default is 0.

The initial value can be set using the environment variable DIRECTVIZ_NUM_ENV_LIGHTS. See SoPreferences. Since Open Inventor 8.0

Specifies the number of steps (intermediate images) between subsampled rendering and full resolution rendering.


Must be greater than 0. Default is 5.

The initial value can be set using the environment variable DIRECTVIZ_RENDER_STEPS. See SoPreferences.

Activates/deactivates rendering with progressive resolution.


Progressive rendering consists of making several render steps between the subsampled image and the full resolution image. The number of steps can be controlled with the numProgressiveRenderingSteps field. Default is FALSE.

The initial value can be set using the environment variable DIRECTVIZ_PROGRESSIVE_RENDERING. See SoPreferences.

Specifies the recursion depth limit.


This is the maximum number of times a single ray can be reflected/refracted - "bounced" within the scene - when rendering a frame. Reflection (ray reflected by a shape) is enabled when the recursion limit is at least 2. Refraction (ray traversing a shape) is enabled when the recursion limit is at least 3. Default is 20.

The initial value can be set using the environment variable DIRECTVIZ_RECURSION_LIMIT. See SoPreferences.

Activates/deactivates ray-traced rendering.


If TRUE, ray-traced rendering is enabled. Default is FALSE.

Enables/disables soft shadows globally in the scene graph.


Default is FALSE.

The initial value can be set using the environment variable DIRECTVIZ_SOFT_SHADOWS. See SoPreferences. Since Open Inventor 7.2

Enables/disables recursion when subsampling the scene.


Rendering may be sped up during interaction with the scene or when scene is animated by setting subRecursion to FALSE: it will force the recursion limit to 1 and therefore prevent reflections and refractions. Default is TRUE.

The initial value can be set using the environment variable DIRECTVIZ_SUB_RECURSION. See SoPreferences.

Activates/deactivates image sub-sampling.


Sub-sampling consists of rendering a smaller (i.e., lower resolution) image when the viewer is not still. Sub-sampling is controlled by a factor that represents the ratio between the rendered image and the full resolution image. Values can range from 0. to 1.0 (full resolution). To set this factor, use the subSamplingFactor field. Default is TRUE.

The initial value can be set using the environment variable DIRECTVIZ_SUBSAMPLING. See SoPreferences.

Specifies the sub-sampling factor.


Values can range from 0. to 1. Default value is 0.5. The initial value can be set using the environment variable DIRECTVIZ_SUBSAMPLING_FACTOR. See SoPreferences.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/