#include <optix_types.h>
Public Attributes | |
OptixPrimitiveType | curveType |
unsigned int | numPrimitives |
const CUdeviceptr * | vertexBuffers |
unsigned int | numVertices |
unsigned int | vertexStrideInBytes |
const CUdeviceptr * | widthBuffers |
unsigned int | widthStrideInBytes |
const CUdeviceptr * | normalBuffers |
unsigned int | normalStrideInBytes |
CUdeviceptr | indexBuffer |
unsigned int | indexStrideInBytes |
unsigned int | flag |
unsigned int | primitiveIndexOffset |
unsigned int | endcapFlags |
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.
OptixPrimitiveType OptixBuildInputCurveArray::curveType |
Curve degree and basis.
unsigned int OptixBuildInputCurveArray::endcapFlags |
End cap flags, see OptixCurveEndcapFlags.
unsigned int OptixBuildInputCurveArray::flag |
Combination of OptixGeometryFlags describing the primitive behavior.
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.
unsigned int OptixBuildInputCurveArray::indexStrideInBytes |
Stride between indices. If set to zero, indices are assumed to be tightly packed and stride is sizeof( unsigned int ).
const CUdeviceptr* OptixBuildInputCurveArray::normalBuffers |
Reserved for future use.
unsigned int OptixBuildInputCurveArray::normalStrideInBytes |
Reserved for future use.
unsigned int OptixBuildInputCurveArray::numPrimitives |
Number of primitives. Each primitive is a polynomial curve segment.
unsigned int OptixBuildInputCurveArray::numVertices |
Number of vertices in each buffer in vertexBuffers.
unsigned int OptixBuildInputCurveArray::primitiveIndexOffset |
Primitive index bias, applied in optixGetPrimitiveIndex(). Sum of primitiveIndexOffset and number of primitives must not overflow 32bits.
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).
unsigned int OptixBuildInputCurveArray::vertexStrideInBytes |
Stride between vertices. If set to zero, vertices are assumed to be tightly packed and stride is sizeof( float3 ).
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.
unsigned int OptixBuildInputCurveArray::widthStrideInBytes |
Stride between widths. If set to zero, widths are assumed to be tightly packed and stride is sizeof( float ).