5.1.3. What is Real Time Ray-tracing?

Rendering realism

Ray-tracing is well known for generating high-quality realistic images. This general technique uses principles of optics to model the path taken by light by following rays of light as they interact with surfaces.

Ray-tracing modeling light paths

Figure 5.3. Ray-tracing modeling light paths



In the DirectViz ray-tracing engine OpenRTRT, a component controlling the rendering mechanism is called a rendering object. Here is an outline of the typical steps for computing an image.

  • Starting from the camera, a primary ray is shot for every image pixel by a camera shader .

  • For every primary ray, the intersection with the closest object is computed, and a surface shader is invoked, responsible for computing the color of the intersection point depending on material's optical parameters .

  • A surface shader shoots shadow rays for checking whether the intersection point is lit or hidden from each light source. Light shaders then compute the amount of illumination.

  • A surface shader can also shoot secondary rays according to possible reflections from the surface and refractions through the surface, simulating the light path affected by material properties.

  • Secondary rays can trigger in turn other surface shaders and additional rays, recursively as necessary until they would not further contribute significantly to the image, eventually stopped by a recursion depth limit .

  • If a “lost” ray did not hit any object, an environment shader may be invoked.

This is a very different approach to image synthesis compared to the current hardware-accelerated OpenGL pipeline, which is based on projection and rasterization of the polygons in the scene. Ray-tracing allows visual effects that are too complex or impossible to achieve with OpenGL or GPU shaders, such as accurate reflections, refractions, shadows… even on highly complex models. Going beyond the “nice looking” images that can be generated with classical hardware rendering, ray-tracing is able to provide much more realist, physically correct images.

DirectViz rendering – notice the rendering details not possible with OpenGL

Figure 5.4. DirectViz rendering – notice the rendering details not possible with OpenGL



With ray-tracing, visual appearance is controlled via shader objects. DirectViz automatically turns Open Inventor objects such as Camera, Light, and Material nodes into appropriate ray-tracing shaders. DirectViz also introduces new fields and new property nodes that can be used for controlling a wide range of rendering effects such as glass, car paint, environment mapping, or bump mapping.

With DirectViz you will be able to quickly enhance rendering in your Open Inventor application. Open Inventor DirectViz also provides a high-level framework for creating or extending other applications with real time ray-tracing.

While similar in a number of concepts, ray-tracing shaders should not be confused with OpenGL programmable shaders, just as DirectViz should not be confused with other Open Inventor features such as FXViz effects and OpenGL shaders. Those features only relate to OpenGL (GPU) rendering and are ignored by DirectViz.

Performance and Scalability

Ray-tracing is well known to be computation intensive, the price to pay for rendering quality. However advances in algorithms and processor power now make possible interactive use of ray-tracing even on commodity hardware.

DirectViz is based on the Real Time Ray-tracing engine OpenRTRT™ initialy developed by the OpenRT research project lead by Dr. Philipp Slusallek at University of Saarbrücken. OpenRTRT is now maintained and improved by FEI.

OpenRTRT is extremely optimized to take best advantage of the processing power offered by modern CPUs, as GPUs do not yet offer a better architecture for ray-tracing. DirectViz uses OpenGL only for image display.

DirectViz performance depends on the number of processed rays, which in turn depends on the resolution of the rendered frame and the “optical complexity” of the scene, such as the number of reflections or the number of light sources. DirectViz allows control of performance/quality tradeoffs for interaction on different hardware configurations. At any time you can also switch between OpenGL and DirectViz rendering.

DirectViz can either be run in stand-alone mode on a single machine, or in a cluster configuration. DirectViz can take advantage of a cluster of interconnected computers for accelerating rendering performance: for instance, higher frame rates or resolutions can be sustained by simply adding new slave rendering nodes. DirectViz also takes advantage of multi-processor/multi-core systems.

DirectViz has interesting capabilities with regard to scene size (number of polygons). The ray-tracing engine maintains a spatial search acceleration structure for fast computation of ray intersections with each defined geometry object. The rendering time then depends on the logarithm of the number of polygons. There is also the benefit of built-in occlusion culling as hidden objects do not receive rays. Therefore DirectViz performance is less dependent on geometric complexity of the scene than OpenGL. It may be possible to visualize very large models with DirectViz without the simplification usually required by other OpenGL-based software. DirectViz can also efficiently support dynamic and interactive scenes (rigid body animations).

When used in conjunction with the ScaleViz extension, DirectViz can also be used on visualization platforms with multiple tiled screens, immersive display configurations, and remote rendering for building visualization servers.