5.5.2. DirectViz Shaders

In the ray-tracing rendering engine, shaders are the components responsible for “bouncing” rays and computing ray colors. Open Inventor nodes such as materials, lights, and cameras are automatically translated into appropriate shaders. For instance a surface shader can be seen as a kind of material gathering the different physical surface parameters used for rendering. DirectViz allows the direct use of shaders, exposing parameters for advanced rendering features of ray-tracing that standard Open Inventor material nodes do not provide.

The rendering process and the shaders are controlled by a rendering object . A shader package is a rendering framework gathering a rendering object and an associated set of shaders. The current release of DirectViz includes one shader package named RTX.

The RTX package supports the following rendering features:

DirectViz shaders are encapsulated into the SoDirectVizGeneralShader SoDirectVizGeneralShader SoDirectVizGeneralShader property node, which can be used in the same way as SoMaterial SoMaterial SoMaterial nodes are used.

Generic shaders are described by three fields:

  • name: the name of the shader class

  • file: the shared library or DLL containing the shader. Never use the “.so” or “.dll” extensions, for cross platform compatibility. The extension is automatically translated to “.dll” on Windows and “.so” on Linux. For RTX shaders, use “libRTX”. options: a list of self-typed parameters, each described by a string “ type name value ”, where type can be color (R G B), 1f (float), 1i (integer), bool (true or false), texture (filename).