NVIDIA OptiX 7.7 nvidia_logo_transpbg.gif Up
OptixBuildInputCurveArray Struct Reference

#include <optix_types.h>

Public Attributes

OptixPrimitiveType curveType
 
unsigned int numPrimitives
 
const CUdeviceptrvertexBuffers
 
unsigned int numVertices
 
unsigned int vertexStrideInBytes
 
const CUdeviceptrwidthBuffers
 
unsigned int widthStrideInBytes
 
const CUdeviceptrnormalBuffers
 
unsigned int normalStrideInBytes
 
CUdeviceptr indexBuffer
 
unsigned int indexStrideInBytes
 
unsigned int flag
 
unsigned int primitiveIndexOffset
 
unsigned int endcapFlags
 

Detailed Description

Curve inputs.

A curve is a swept surface defined by a 3D spline curve and a varying width (radius). A curve (or "strand") of degree d (3=cubic, 2=quadratic, 1=linear) is represented by N > d vertices and N width values, and comprises N - d segments. Each segment is defined by d+1 consecutive vertices. Each curve may have a different number of vertices.

OptiX describes the curve array as a list of curve segments. The primitive id is the segment number. It is the user's responsibility to maintain a mapping between curves and curve segments. Each index buffer entry i = indexBuffer[primid] specifies the start of a curve segment, represented by d+1 consecutive vertices in the vertex buffer, and d+1 consecutive widths in the width buffer. Width is interpolated the same way vertices are interpolated, that is, using the curve basis.

Each curves build input has only one SBT record. To create curves with different materials in the same BVH, use multiple build inputs.

See also
OptixBuildInput::curveArray

Member Data Documentation

 curveType

OptixPrimitiveType OptixBuildInputCurveArray::curveType

Curve degree and basis.

See also
OptixPrimitiveType

 endcapFlags

unsigned int OptixBuildInputCurveArray::endcapFlags

End cap flags, see OptixCurveEndcapFlags.

 flag

unsigned int OptixBuildInputCurveArray::flag

Combination of OptixGeometryFlags describing the primitive behavior.

 indexBuffer

CUdeviceptr OptixBuildInputCurveArray::indexBuffer

Device pointer to array of unsigned ints, one per curve segment. This buffer is required (unlike for OptixBuildInputTriangleArray). Each index is the start of degree+1 consecutive vertices in vertexBuffers, and corresponding widths in widthBuffers and normals in normalBuffers. These define a single segment. Size of array is numPrimitives.

 indexStrideInBytes

unsigned int OptixBuildInputCurveArray::indexStrideInBytes

Stride between indices. If set to zero, indices are assumed to be tightly packed and stride is sizeof( unsigned int ).

 normalBuffers

const CUdeviceptr* OptixBuildInputCurveArray::normalBuffers

Reserved for future use.

 normalStrideInBytes

unsigned int OptixBuildInputCurveArray::normalStrideInBytes

Reserved for future use.

 numPrimitives

unsigned int OptixBuildInputCurveArray::numPrimitives

Number of primitives. Each primitive is a polynomial curve segment.

 numVertices

unsigned int OptixBuildInputCurveArray::numVertices

Number of vertices in each buffer in vertexBuffers.

 primitiveIndexOffset

unsigned int OptixBuildInputCurveArray::primitiveIndexOffset

Primitive index bias, applied in optixGetPrimitiveIndex(). Sum of primitiveIndexOffset and number of primitives must not overflow 32bits.

 vertexBuffers

const CUdeviceptr* OptixBuildInputCurveArray::vertexBuffers

Pointer to host array of device pointers, one per motion step. Host array size must match number of motion keys as set in OptixMotionOptions (or an array of size 1 if OptixMotionOptions::numKeys is set to 1). Each per-motion-key device pointer must point to an array of floats (the vertices of the curves).

 vertexStrideInBytes

unsigned int OptixBuildInputCurveArray::vertexStrideInBytes

Stride between vertices. If set to zero, vertices are assumed to be tightly packed and stride is sizeof( float3 ).

 widthBuffers

const CUdeviceptr* OptixBuildInputCurveArray::widthBuffers

Parallel to vertexBuffers: a device pointer per motion step, each with numVertices float values, specifying the curve width (radius) corresponding to each vertex.

 widthStrideInBytes

unsigned int OptixBuildInputCurveArray::widthStrideInBytes

Stride between widths. If set to zero, widths are assumed to be tightly packed and stride is sizeof( float ).