1.9. Cross-Platform Extensions

Open Inventor supplies a set of classes designed for real-time rendering of very large models. These tools can be divided into several categories:

Using multiple threads in an application can increase overall performance by making use of multiple processors, or better use of a single processor. This also enables use of multiple graphics pipes. Now, multiple graphics windows can each have their own rendering thread, multiplethreads can simultaneously traverse the same scene graph, and modification and traversal of the scene graph can safely occur in different threads. Open Inventor can also be used in immersive VR applications based on tools like CAVELib™ and Multipipe SDK™.Chapter 23, Multithreading, gives you full details on multithreading.

The SoTrackerEvent( C++ | Java | .NET )and SoControllerButtonEvent( C++ | Java | .NET )classes have been designed to be useful in immersive VR applications that use tracking. For instance, a “wand” device can generate SoTrackerEvents when moving and SoControllerButtonEvents when a button is pressed. All classes that respond to SoMouseButtonEvent( C++ | Java | .NET ) (i.e., SoSelection( C++ | Java | .NET ), SoExtSelection( C++ | Java | .NET ), etc.) also respond to SoControllerButtonEvents. All dragger classes also respond to SoTrackerEvents and SoControllerButtonEvents. So, for example, a wand input device can be used to interact with draggers and manipulators in an immersive environment. Chapter 25, Immersive Virtual Reality discusses these events.

Open Inventor supports detection of collisions between the viewer (camera) and the scene, collisions between objects in the scene, as well as collsions between two scene graphs, one moving and one static. The following classes have been added to handle these kinds of collisions:

Chapter 22, Collision Detection explains how to use these classes.

Open Inventor supports high quality stereo projection with different types of stereo modes to render your virtual model with high realism. Software stereo is supported as well as hardware stereo (OpenGL stereo). Furthermore, a new graphical user interface dialog box, accessible from the Stereo menu item of the viewer popup menu, allows the user to interactively select the stereo mode and make adjustments to various stereo parameters.Chapter 19, Stereo Viewing , describes how to use and configure these different stereo types.

Open Inventor provides support for programmable vertex, geometry, and fragment (pixel) shaders, allowing you to take advantage of the latest generation of graphics cards to produce more advanced real-time rendering effects.

Programming in the following languages is supported (depending, of course, on support for these shader languages by your graphics card):

The following classes provide support for programmable vertex, geometry and fragment shaders:

  • SoShaderObject( C++ | Java | .NET ) (abstract)

  • SoVertexShader

  • SoGeometryShader

  • SoFragmentShader

  • SoShaderParameter (and subclasses)

  • SoShaderProgram

The basic approach is to:

  1. Write your shader code and load it into a SoVertexShader and/or SoGeometryShader and/or SoFragmentShader node. Use SoShaderParameter to set parameters (float, integer, vector, etc.) as necessary.

  2. Combine your shaders into an SoShaderProgram( C++ | Java | .NET ). They should be directly referenced by the multiple field SoShaderProgram::shaderObject.

  3. Insert this SoShaderProgram( C++ | Java | .NET ) object in your scene graph above above the shapes in the scene graph that should be affected by it

Chapter 21, Shaders deals with this topic.

Remote rendering allows an Open Inventor application to both execute and render on a remote server machine. Only the optimized and compressed rendered images are sent to the local machine. This allows very large data sets to be centralized and handled on a machine with more memory, processors, and graphics hardware.

Chapter 26, Remote Rendering deals with this extension.

In addition to the actions for large model visualization and collision detection, the following new actions are available:

Open Inventor has followed the evolution of graphics boards and OpenGL in terms of texturing support. Furthermore, numerous other features have been added to provide more flexibility and improve performance. The following features have been added:

  • Multitexture support: SoTextureUnit( C++ | Java | .NET ).

  • 3D texture support: SoTexture3( C++ | Java | .NET ), SoTextureCoordinate3( C++ | Java | .NET ), SoTexture3Transform( C++ | Java | .NET ).

  • Cube map texture support: SoTextureCubeMap( C++ | Java | .NET ).

  • Access to the texture matrix: SoTextureMatrix( C++ | Java | .NET ).

  • Anisotropic filtering: SoTexture::maxAnisotropy.

  • Texture compression: SoTexture::enableTextureCompression.

  • Sub texturing support: SoSFImage::setSubValues() and SoSFImage3::setSubValues().

  • Texture filtering control: SoTexture::minFilter and SoTexture::magFilter.

  • Texture borders support: SoTexture::enableBorder and SoTexture::borderColor.

  • New texture wrapping modes: SoTexture::CLAMP_TO_BORDER, SoTexture::CLAMP_TO_EDGE, SoTexture::MIRRORED_REPEAT.

  • New texture-coordinate functions:SoTextureCoordinateNormalMap( C++ | Java | .NET ), SoTextureCoordinateReflectionMap( C++ | Java | .NET ), SoTextureCoordinateObject( C++ | Java | .NET ).

  • New texture models and programmable texture models to better control how texture map are combined with underlying colors: SoTexture::REPLACE, SoTexture::ADD, SoTexture::COMBINE, and SoTextureCombiner( C++ | Java | .NET ).

  • Texture 2D node which manages the memory consumption and asynchronous texture loading: SoExtTexture2( C++ | Java | .NET ).

  • Sharing textures between different OpenGL contexts.

  • Support for sending non-power-of-two textures directly to OpenGL (if the OpenGL NPOT extension is supported by the graphics card) (SoTexture( C++ | Java | .NET )).

  • Support for mipmap generation in the graphics hardware (if supported by OpenGL on the graphics card) (SoTexture::useAutoMipmap).

  • Support for reading DDS format files (SoTexture2( C++ | Java | .NET ), SoTextureCubeMap( C++ | Java | .NET ), SoExtTexture2) (if supported by OpenGL on the graphics card)

  • SoRenderToTextureProperty( C++ | Java | .NET ): Render to texture capability for SoTexture2( C++ | Java | .NET ) and SoTextureCubeMap( C++ | Java | .NET ).

  • Floating point texture formats for SoTexture2( C++ | Java | .NET ) and SoTextureCubeMap( C++ | Java | .NET ) (if supported by OpenGL on the graphics card).

  • SoIndexedTexture2( C++ | Java | .NET ): Specifies a 2D texture and associated parameters for texture mapping (using indexed colors)

  • SoColorMap( C++ | Java | .NET ): Used with indexed textures.

When creating your application with Open Inventor, you may need to use external dynamic libraries for specific purposes. However, the need for these libraries can depend on the use of the application. In order to save memory and loading time at start-up, you can load these dynamic libraries “on the fly” only when required.

The class SoDynamicLibManager( C++ )manages the loading and the unloading of a dynamic library (cross-platform). You can query the list of all loaded libraries or whether a specific library is currently loaded. You can also inquire whether a specific library supports a particular function.

This class is used by Open Inventor to load the following libraries: Zlib, libJpeg, libTiff, libPng, libJasper, OpenAL (Windows only), FreeType.

The library name given to the load method can include an absolute or relative path. If no path is supplied, the library will be searched for in the following paths:

In addition to the extension nodes mentioned previously, the following new nodes have been added by FEI: