hierarchy nodes. A scene is represented as a lightweight
graph that controls the traversal of rays through the scene.
It can also be used to implement instancing two-level
hierarchies for animations of rigid objects, or other common scene structures. To support instancing and sharing of
common data, the nodes can have multiple parents.
Four main node types can be used to provide the scene
representation using a directed graph. Any node can be used
as the root of scene traversal. This allows, for example, different representations to be used for different ray types.
Group nodes contain zero or more (but usually two or
more) children of any node type. A group node has an acceleration structure associated with it and can be used to provide the top level of a two-level traversal structure.
Geometry Group nodes are the leaves of the graph and
contain the primitive and material objects described below.
This node type also has an acceleration structure associated
with it. Any non-empty scene will contain at least one geometry group.
Transform nodes have a single child of any node type, plus
an associated 4× 3 matrix that is used to perform an affine
transformation of the underlying geometry.
Selector nodes have zero or more children of any node
type, plus a single visit program that is executed to select
among the available children.
geometry and material objects. The bulk of the scene
data is stored in the geometry nodes at the leaves of the
graph. These contain objects that define geometry and
shading operations. They may also have multiple parents,
allowing material and geometry information to be shared
at multiple points in the graph. As an example, consider
Figure 3. The graph on the right shows a complete OptiX
context for a simple scene with a pin-hole camera, two
objects, and shadows. The ray generation program implements the camera, while a miss program implements
a constant white background. A single geometry group
contains two geometry instances with a single geometric
index—in this case a bounding-volume hierarchy (BVH)—
built over all underlying geometry in the triangle mesh and
ground plane. Two types of geometry are implemented,
a triangle mesh and a parallelogram, each with its own
figure 3. example optiX scene construction and execution.
set of intersection and bounding box programs. The two
geometry instances share a single material that implements
a diffuse lighting model and fully attenuates shadow rays
via closest-hit and any-hit programs, respectively.
The diagram on the left of Figure 3 illustrates how these
programs are invoked for 3 rays that traverse through the
scene: 1. The ray generation program creates rays and
traces them against the geometry group. This initiates
the Traverse stage shown in Figure 2, executing parallelogram and triangle-mesh intersection until an intersection
is found ( 2 and 3). If the ray intersects with geometry, the
closest-hit program will be called whether the intersection
was found on the ground plane or on the triangle mesh.
The material will recursively generate show rays to determine if the light source is unobstructed. 4. When any intersection along the shadow ray is found, the any-hit program
will terminate ray traversal and return to the calling program with shadow occlusion information. 5. If a ray does
not intersect with any scene geometry, the miss program
will be invoked.
Geometry Instance objects bind a geometry object to a
set of material objects. This is a common structure used by
scene graphs to keep geometric and shading information
Geometry objects contain a list of geometric primitives.
Each geometry object is associated with a bounding box program and an intersection program, both of which are shared
among the geometry object’s primitives.
Material objects hold information about shading operations, including the any-hit and closest-hit programs
described in Section 3. 1.
3. 3. System overview
The OptiX engine consists of two distinct APIs. The host API
is a set of C functions that the client application calls to create and configure a context, assemble a node graph, and
launch ray tracing kernels. It also provides calls to manage
GPU devices. The program API is the functionality exposed to
user programs. This includes function calls for tracing rays,
reporting intersections, and accessing data. In addition, several semantic variables encode state specific to ray tracing,