NVIDIA OptiX 7.1 API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
OptixBuildInputInstanceArray Struct Reference

Public Attributes

CUdeviceptr instances
 
unsigned int numInstances
 
CUdeviceptr aabbs
 
unsigned int numAabbs
 

Detailed Description

Instance and instance pointer inputs.

See Also
OptixBuildInput::instanceArray

Member Data Documentation

CUdeviceptr OptixBuildInputInstanceArray::aabbs

Optional AABBs. In OptixAabb format.

Required for traversables (OptixMatrixMotionTransform, OptixSRTMotionTransform, OptixStaticTransform) and certain configurations of motion AS as instance. Will be ignored for non-motion AS, since no AABBs are required. May be NULL in that case.

The following table illustrates this (IAS is Instance Acceleration Structure) instance type | traversable | motion AS | static AS building a motion IAS | required | required | ignored building a static IAS | required | ignored | ignored

The AABBs must enclose the space spanned by the referenced handle of the instance. I.e., the AABBs are in 'object space' and must NOT include the transformation of the instance itself. If the instance's handle references a traversable the AABBs must contain the transformation of the traversable.

If OptixBuildInput::type is OPTIX_BUILD_INPUT_TYPE_INSTANCE_POINTERS the unused pointers for unused aabbs may be set to NULL.

If OptixBuildInput::type is OPTIX_BUILD_INPUT_TYPE_INSTANCES this pointer must be a multiple of OPTIX_AABB_BUFFER_BYTE_ALIGNMENT. If OptixBuildInput::type is OPTIX_BUILD_INPUT_TYPE_INSTANCE_POINTERS the array elements must be a multiple of OPTIX_AABB_BUFFER_BYTE_ALIGNMENT.

Motion:

In case of motion (OptixMotionOptions::numKeys>=2), OptixMotionOptions::numKeys aabbs are expected per instance, e.g., for N instances and M motion keys: aabb[inst0][t0], aabb[inst0][t1], ..., aabb[inst0][tM-1], ..., aabb[instN-1][t0], aabb[instN-1][t1],..., aabb[instN-1][tM-1].

If OptixBuildInput::type is OPTIX_BUILD_INPUT_TYPE_INSTANCES aabbs must be a device pointer to an array of N * M * 6 floats.

If OptixBuildInput::type is OPTIX_BUILD_INPUT_TYPE_INSTANCE_POINTERS aabbs must be a device pointer to an array of N device pointers, each pointing to an array of M * 6 floats in OptixAabb format. Pointers may be NULL if the aabbs are not required. Hence, if the second instance (inst1) points to a static GAS, aabbs are not required for that instance. While being ignored, aabbs must still be a device pointer to an array of N elements.

In case of OPTIX_BUILD_INPUT_TYPE_INSTANCES, the second element (with a size of M * 6 floats) will be ignored. In case of OPTIX_BUILD_INPUT_TYPE_INSTANCE_POINTERS, the second element (with a size of pointer to M * 6 floats) can be NULL.

CUdeviceptr OptixBuildInputInstanceArray::instances

If OptixBuildInput::type is OPTIX_BUILD_INPUT_TYPE_INSTANCE_POINTERS instances and aabbs should be interpreted as arrays of pointers instead of arrays of structs.

This pointer must be a multiple of OPTIX_INSTANCE_BYTE_ALIGNMENT if OptixBuildInput::type is OPTIX_BUILD_INPUT_TYPE_INSTANCES. The array elements must be a multiple of OPTIX_INSTANCE_BYTE_ALIGNMENT if OptixBuildInput::type is OPTIX_BUILD_INPUT_TYPE_INSTANCE_POINTERS.

unsigned int OptixBuildInputInstanceArray::numAabbs

number of aabbs, in case of motion, this needs to match numInstances multiplied with OptixMotionOptions::numKeys

unsigned int OptixBuildInputInstanceArray::numInstances