5.5.1. Quick Steps

When activating DirectViz, you may notice some differences in the rendering as compared to OpenGL, which may be due to:

One of the most stunning effects of ray-tracing is the realistic rendering of glass. The SoMaterial SoMaterial SoMaterial and SoVRMLMaterial SoVRMLMaterial SoVRMLMaterial nodes with transparency value greater than zero are automatically rendered using a glass shader, so that all transparent objects of an Open Inventor or VRML scene appear as if they were made of glass. Glass rendering is discussed in further detail later in this chapter.

A scene can be greatly enhanced by adding an environment, a “background” surrounding the geometry of the scene, nicely reflected on the scene objects.

DirectViz allows you to easily specify environments by adding an SoDirectVizEnvironmentShader SoDirectVizEnvironmentShader SoDirectVizEnvironmentShader node to the scene graph. Only one environment can be used in a scene. This node contains two fields:

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.

The number of environment lights to extract from the environment texture is controlled with the SoPreferences SoPreferences SoPreferences parameter DIRECTVIZ_NUM_ENV_LIGHTS or the SoDirectVizManager SoDirectVizManager SoDirectVizManager numEnvLights field.

The intensity scale applied to environment lights is controlled with the SoPreferences SoPreferences SoPreferences parameter DIRECTVIZ_ENV_LIGHTS_SCALE or the SoDirectVizManager SoDirectVizManager SoDirectVizManager envLightIntensityScale field.


A key feature of the ray-tracing of DirectViz compared to OpenGL capabilities is the accurate rendering of true reflections within arbitrary scenes.

The SoMaterial SoMaterial SoMaterial and SoVRMLMaterial SoVRMLMaterial SoVRMLMaterial nodes have been extended with a new field, reflectiveColor, for easily enabling this feature in Open Inventor scenes (no need to change the scene structure with insertion of new property nodes):

While the specularColor and shininess fields control the glossy illumination of shape highlights (degree of shininess of an object), the reflectiveColor field controls perfect specular reflections. For more details, see the section called “Phong shader (RTXPhong)”.


DirectViz allows light sources that illuminate a scene to be deflected, which produces fuzzy effects.

This can be achieved globally by enabling the SoPreferences SoPreferences SoPreferences parameter DIRECTVIZ_FUZZY_LIGHTS or the DirectVizManager fuzzyLights field.

Enabling fuzzy light effects implicitely causes the shadows to be smoothed, as the shadow rays are deflected also.

Alternatively fuzzy light effects can be achieved on a per shader basis by the shader parameter fuzzyLights.


DirectViz allows reflections and refractions to be deflected, which produces glossy surfaces effects, which simulate more realistic material behaviors, and offer nonuniform effects. The glossiness of a reflective surface is controlled by the shininess parameter of the current Material node.

Glossy surfaces effects can be achieved globally by enabling the SoPreferences SoPreferences SoPreferences parameter DIRECTVIZ_GLOSSY_SURFACES or the DirectVizManager glossySurfaces field.

Alternatively glossy surfaces effects can be achieved on a per shader basis by the shader parameter glossySurfaces.


A further degree of realism is achieved by enabling shadow casting in the scene. It is possible to control the shadowing per shape with the receiveShadow field of SoMaterial SoMaterial SoMaterial nodes. If the receiveShadow field of an SoMaterial SoMaterial SoMaterial node is set to true, the affected shapes will receive shadows from other shapes.

[Tip]

Enabling shadows for the entire scene is possible via the SoDirectVizManager SoDirectVizManager SoDirectVizManager globalShadowing field, or via the DirectViz control dialog. No change in the scene is required.

Bump mapping is a way of simulating fine surface details such as bumps or wrinkles. This is a normal-perturbation rendering technique for simulating lighting effects caused by patterned irregularities on an otherwise locally smooth surface. The surface patterns are encoded in a normal maptexture.


An SoDirectVizGeneralShader SoDirectVizGeneralShader SoDirectVizGeneralShader node can be used to set bump mapping effects. This property node is further detailed in the section about DirectViz shaders. Here, the name field can be simply set to “Phong” to select the appropriate shader. The options field is used to set the texture bumpMap parameter defining the normal map texture file (see the section called “Phong shader (RTXPhong)” for details).

DirectViz allows all rendering effects to be combined together. The following images show the combined use of bump mapping, soft shadows, glossy surface effects and fuzzy light effects.