NVIDIA OptiX 6.0 API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
optix_host.h File Reference

Go to the source code of this file.

Typedefs

typedef struct RTacceleration_api * RTacceleration
 
typedef struct RTbuffer_api * RTbuffer
 
typedef struct RTcontext_api * RTcontext
 
typedef struct RTgeometry_api * RTgeometry
 
typedef struct
RTgeometrytriangles_api * 
RTgeometrytriangles
 
typedef struct
RTgeometryinstance_api * 
RTgeometryinstance
 
typedef struct
RTgeometrygroup_api * 
RTgeometrygroup
 
typedef struct RTgroup_api * RTgroup
 
typedef struct RTmaterial_api * RTmaterial
 
typedef struct RTprogram_api * RTprogram
 
typedef struct RTselector_api * RTselector
 
typedef struct
RTtexturesampler_api * 
RTtexturesampler
 
typedef struct RTtransform_api * RTtransform
 
typedef struct RTvariable_api * RTvariable
 
typedef void * RTobject
 
typedef struct
RTpostprocessingstage_api * 
RTpostprocessingstage
 
typedef struct RTcommandlist_api * RTcommandlist
 
typedef int(* RTtimeoutcallback )(void)
 
typedef void(* RTusagereportcallback )(int, const char *, const char *, void *)
 

Functions

RTresult RTAPI rtGetVersion (unsigned int *version)
 
RTresult RTAPI rtGlobalSetAttribute (RTglobalattribute attrib, RTsize size, const void *p)
 
RTresult RTAPI rtGlobalGetAttribute (RTglobalattribute attrib, RTsize size, void *p)
 
RTresult RTAPI rtDeviceGetDeviceCount (unsigned int *count)
 
RTresult RTAPI rtDeviceGetAttribute (int ordinal, RTdeviceattribute attrib, RTsize size, void *p)
 
RTresult RTAPI rtVariableSetObject (RTvariable v, RTobject object)
 
RTresult RTAPI rtVariableSetUserData (RTvariable v, RTsize size, const void *ptr)
 
RTresult RTAPI rtVariableGetObject (RTvariable v, RTobject *object)
 
RTresult RTAPI rtVariableGetUserData (RTvariable v, RTsize size, void *ptr)
 
RTresult RTAPI rtVariableGetName (RTvariable v, const char **nameReturn)
 
RTresult RTAPI rtVariableGetAnnotation (RTvariable v, const char **annotationReturn)
 
RTresult RTAPI rtVariableGetType (RTvariable v, RTobjecttype *typeReturn)
 
RTresult RTAPI rtVariableGetContext (RTvariable v, RTcontext *context)
 
RTresult RTAPI rtVariableGetSize (RTvariable v, RTsize *size)
 
RTresult RTAPI rtContextCreate (RTcontext *context)
 
RTresult RTAPI rtContextDestroy (RTcontext context)
 
RTresult RTAPI rtContextValidate (RTcontext context)
 
void RTAPI rtContextGetErrorString (RTcontext context, RTresult code, const char **stringReturn)
 
RTresult RTAPI rtContextSetAttribute (RTcontext context, RTcontextattribute attrib, RTsize size, const void *p)
 
RTresult RTAPI rtContextGetAttribute (RTcontext context, RTcontextattribute attrib, RTsize size, void *p)
 
RTresult RTAPI rtContextSetDevices (RTcontext context, unsigned int count, const int *devices)
 
RTresult RTAPI rtContextGetDevices (RTcontext context, int *devices)
 
RTresult RTAPI rtContextGetDeviceCount (RTcontext context, unsigned int *count)
 
RTresult RTAPI rtContextSetStackSize (RTcontext context, RTsize bytes)
 
RTresult RTAPI rtContextGetStackSize (RTcontext context, RTsize *bytes)
 
RTresult RTAPI rtContextSetMaxCallableProgramDepth (RTcontext context, unsigned int maxDepth)
 
RTresult RTAPI rtContextGetMaxCallableProgramDepth (RTcontext context, unsigned int *maxDepth)
 
RTresult RTAPI rtContextSetMaxTraceDepth (RTcontext context, unsigned int maxDepth)
 
RTresult RTAPI rtContextGetMaxTraceDepth (RTcontext context, unsigned int *maxDepth)
 
RTresult RTAPI rtContextSetTimeoutCallback (RTcontext context, RTtimeoutcallback callback, double minPollingSeconds)
 
RTresult RTAPI rtContextSetUsageReportCallback (RTcontext context, RTusagereportcallback callback, int verbosity, void *cbdata)
 
RTresult RTAPI rtContextSetEntryPointCount (RTcontext context, unsigned int count)
 
RTresult RTAPI rtContextGetEntryPointCount (RTcontext context, unsigned int *count)
 
RTresult RTAPI rtContextSetRayGenerationProgram (RTcontext context, unsigned int entryPointIndex, RTprogram program)
 
RTresult RTAPI rtContextGetRayGenerationProgram (RTcontext context, unsigned int entryPointIndex, RTprogram *program)
 
RTresult RTAPI rtContextSetExceptionProgram (RTcontext context, unsigned int entryPointIndex, RTprogram program)
 
RTresult RTAPI rtContextGetExceptionProgram (RTcontext context, unsigned int entryPointIndex, RTprogram *program)
 
RTresult RTAPI rtContextSetExceptionEnabled (RTcontext context, RTexception exception, int enabled)
 
RTresult RTAPI rtContextGetExceptionEnabled (RTcontext context, RTexception exception, int *enabled)
 
RTresult RTAPI rtContextSetRayTypeCount (RTcontext context, unsigned int rayTypeCount)
 
RTresult RTAPI rtContextGetRayTypeCount (RTcontext context, unsigned int *rayTypeCount)
 
RTresult RTAPI rtContextSetMissProgram (RTcontext context, unsigned int rayTypeIndex, RTprogram program)
 
RTresult RTAPI rtContextGetMissProgram (RTcontext context, unsigned int rayTypeIndex, RTprogram *program)
 
RTresult RTAPI rtContextGetTextureSamplerFromId (RTcontext context, int samplerId, RTtexturesampler *sampler)
 
RTresult RTAPI rtContextCompile (RTcontext context)
 
RTresult RTAPI rtContextLaunch1D (RTcontext context, unsigned int entryPointIndex, RTsize width)
 
RTresult RTAPI rtContextLaunch2D (RTcontext context, unsigned int entryPointIndex, RTsize width, RTsize height)
 
RTresult RTAPI rtContextLaunch3D (RTcontext context, unsigned int entryPointIndex, RTsize width, RTsize height, RTsize depth)
 
RTresult RTAPI rtContextGetRunningState (RTcontext context, int *running)
 
RTresult RTAPI rtContextLaunchProgressive2D (RTcontext context, unsigned int entryIndex, RTsize width, RTsize height, unsigned int maxSubframes)
 
RTresult RTAPI rtContextStopProgressive (RTcontext context)
 
RTresult RTAPI rtContextSetPrintEnabled (RTcontext context, int enabled)
 
RTresult RTAPI rtContextGetPrintEnabled (RTcontext context, int *enabled)
 
RTresult RTAPI rtContextSetPrintBufferSize (RTcontext context, RTsize bufferSizeBytes)
 
RTresult RTAPI rtContextGetPrintBufferSize (RTcontext context, RTsize *bufferSizeBytes)
 
RTresult RTAPI rtContextSetPrintLaunchIndex (RTcontext context, int x, int y, int z)
 
RTresult RTAPI rtContextGetPrintLaunchIndex (RTcontext context, int *x, int *y, int *z)
 
RTresult RTAPI rtContextDeclareVariable (RTcontext context, const char *name, RTvariable *v)
 
RTresult RTAPI rtContextQueryVariable (RTcontext context, const char *name, RTvariable *v)
 
RTresult RTAPI rtContextRemoveVariable (RTcontext context, RTvariable v)
 
RTresult RTAPI rtContextGetVariableCount (RTcontext context, unsigned int *count)
 
RTresult RTAPI rtContextGetVariable (RTcontext context, unsigned int index, RTvariable *v)
 
RTresult RTAPI rtProgramCreateFromPTXString (RTcontext context, const char *ptx, const char *programName, RTprogram *program)
 
RTresult RTAPI rtProgramCreateFromPTXStrings (RTcontext context, unsigned int n, const char **ptxStrings, const char *programName, RTprogram *program)
 
RTresult RTAPI rtProgramCreateFromPTXFile (RTcontext context, const char *filename, const char *programName, RTprogram *program)
 
RTresult RTAPI rtProgramCreateFromPTXFiles (RTcontext context, unsigned int n, const char **filenames, const char *programName, RTprogram *program)
 
RTresult RTAPI rtProgramDestroy (RTprogram program)
 
RTresult RTAPI rtProgramValidate (RTprogram program)
 
RTresult RTAPI rtProgramGetContext (RTprogram program, RTcontext *context)
 
RTresult RTAPI rtProgramDeclareVariable (RTprogram program, const char *name, RTvariable *v)
 
RTresult RTAPI rtProgramQueryVariable (RTprogram program, const char *name, RTvariable *v)
 
RTresult RTAPI rtProgramRemoveVariable (RTprogram program, RTvariable v)
 
RTresult RTAPI rtProgramGetVariableCount (RTprogram program, unsigned int *count)
 
RTresult RTAPI rtProgramGetVariable (RTprogram program, unsigned int index, RTvariable *v)
 
RTresult RTAPI rtProgramGetId (RTprogram program, int *programId)
 
RTresult RTAPI rtProgramCallsiteSetPotentialCallees (RTprogram program, const char *name, const int *ids, int numIds)
 
RTresult RTAPI rtContextGetProgramFromId (RTcontext context, int programId, RTprogram *program)
 
RTresult RTAPI rtGroupCreate (RTcontext context, RTgroup *group)
 
RTresult RTAPI rtGroupDestroy (RTgroup group)
 
RTresult RTAPI rtGroupValidate (RTgroup group)
 
RTresult RTAPI rtGroupGetContext (RTgroup group, RTcontext *context)
 
RTresult RTAPI rtGroupSetAcceleration (RTgroup group, RTacceleration acceleration)
 
RTresult RTAPI rtGroupSetVisibilityMask (RTgroup group, RTvisibilitymask mask)
 
RTresult RTAPI rtGroupGetVisibilityMask (RTgroup group, RTvisibilitymask *mask)
 
RTresult RTAPI rtGroupGetAcceleration (RTgroup group, RTacceleration *acceleration)
 
RTresult RTAPI rtGroupSetChildCount (RTgroup group, unsigned int count)
 
RTresult RTAPI rtGroupGetChildCount (RTgroup group, unsigned int *count)
 
RTresult RTAPI rtGroupSetChild (RTgroup group, unsigned int index, RTobject child)
 
RTresult RTAPI rtGroupGetChild (RTgroup group, unsigned int index, RTobject *child)
 
RTresult RTAPI rtGroupGetChildType (RTgroup group, unsigned int index, RTobjecttype *type)
 
RTresult RTAPI rtSelectorCreate (RTcontext context, RTselector *selector)
 
RTresult RTAPI rtSelectorDestroy (RTselector selector)
 
RTresult RTAPI rtSelectorValidate (RTselector selector)
 
RTresult RTAPI rtSelectorGetContext (RTselector selector, RTcontext *context)
 
RTresult RTAPI rtSelectorSetVisitProgram (RTselector selector, RTprogram program)
 
RTresult RTAPI rtSelectorGetVisitProgram (RTselector selector, RTprogram *program)
 
RTresult RTAPI rtSelectorSetChildCount (RTselector selector, unsigned int count)
 
RTresult RTAPI rtSelectorGetChildCount (RTselector selector, unsigned int *count)
 
RTresult RTAPI rtSelectorSetChild (RTselector selector, unsigned int index, RTobject child)
 
RTresult RTAPI rtSelectorGetChild (RTselector selector, unsigned int index, RTobject *child)
 
RTresult RTAPI rtSelectorGetChildType (RTselector selector, unsigned int index, RTobjecttype *type)
 
RTresult RTAPI rtSelectorDeclareVariable (RTselector selector, const char *name, RTvariable *v)
 
RTresult RTAPI rtSelectorQueryVariable (RTselector selector, const char *name, RTvariable *v)
 
RTresult RTAPI rtSelectorRemoveVariable (RTselector selector, RTvariable v)
 
RTresult RTAPI rtSelectorGetVariableCount (RTselector selector, unsigned int *count)
 
RTresult RTAPI rtSelectorGetVariable (RTselector selector, unsigned int index, RTvariable *v)
 
RTresult RTAPI rtTransformCreate (RTcontext context, RTtransform *transform)
 
RTresult RTAPI rtTransformDestroy (RTtransform transform)
 
RTresult RTAPI rtTransformValidate (RTtransform transform)
 
RTresult RTAPI rtTransformGetContext (RTtransform transform, RTcontext *context)
 
RTresult RTAPI rtTransformSetMatrix (RTtransform transform, int transpose, const float *matrix, const float *inverseMatrix)
 
RTresult RTAPI rtTransformGetMatrix (RTtransform transform, int transpose, float *matrix, float *inverseMatrix)
 
RTresult RTAPI rtTransformSetMotionRange (RTtransform transform, float timeBegin, float timeEnd)
 
RTresult RTAPI rtTransformGetMotionRange (RTtransform transform, float *timeBegin, float *timeEnd)
 
RTresult RTAPI rtTransformSetMotionBorderMode (RTtransform transform, RTmotionbordermode beginMode, RTmotionbordermode endMode)
 
RTresult RTAPI rtTransformGetMotionBorderMode (RTtransform transform, RTmotionbordermode *beginMode, RTmotionbordermode *endMode)
 
RTresult RTAPI rtTransformSetMotionKeys (RTtransform transform, unsigned int n, RTmotionkeytype type, const float *keys)
 
RTresult RTAPI rtTransformGetMotionKeyType (RTtransform transform, RTmotionkeytype *type)
 
RTresult RTAPI rtTransformGetMotionKeyCount (RTtransform transform, unsigned int *n)
 
RTresult RTAPI rtTransformGetMotionKeys (RTtransform transform, float *keys)
 
RTresult RTAPI rtTransformSetChild (RTtransform transform, RTobject child)
 
RTresult RTAPI rtTransformGetChild (RTtransform transform, RTobject *child)
 
RTresult RTAPI rtTransformGetChildType (RTtransform transform, RTobjecttype *type)
 
RTresult RTAPI rtGeometryGroupCreate (RTcontext context, RTgeometrygroup *geometrygroup)
 
RTresult RTAPI rtGeometryGroupDestroy (RTgeometrygroup geometrygroup)
 
RTresult RTAPI rtGeometryGroupValidate (RTgeometrygroup geometrygroup)
 
RTresult RTAPI rtGeometryGroupGetContext (RTgeometrygroup geometrygroup, RTcontext *context)
 
RTresult RTAPI rtGeometryGroupSetAcceleration (RTgeometrygroup geometrygroup, RTacceleration acceleration)
 
RTresult RTAPI rtGeometryGroupGetAcceleration (RTgeometrygroup geometrygroup, RTacceleration *acceleration)
 
RTresult RTAPI rtGeometryGroupSetFlags (RTgeometrygroup group, RTinstanceflags flags)
 
RTresult RTAPI rtGeometryGroupGetFlags (RTgeometrygroup group, RTinstanceflags *flags)
 
RTresult RTAPI rtGeometryGroupSetVisibilityMask (RTgeometrygroup group, RTvisibilitymask mask)
 
RTresult RTAPI rtGeometryGroupGetVisibilityMask (RTgeometrygroup group, RTvisibilitymask *mask)
 
RTresult RTAPI rtGeometryGroupSetChildCount (RTgeometrygroup geometrygroup, unsigned int count)
 
RTresult RTAPI rtGeometryGroupGetChildCount (RTgeometrygroup geometrygroup, unsigned int *count)
 
RTresult RTAPI rtGeometryGroupSetChild (RTgeometrygroup geometrygroup, unsigned int index, RTgeometryinstance geometryinstance)
 
RTresult RTAPI rtGeometryGroupGetChild (RTgeometrygroup geometrygroup, unsigned int index, RTgeometryinstance *geometryinstance)
 
RTresult RTAPI rtAccelerationCreate (RTcontext context, RTacceleration *acceleration)
 
RTresult RTAPI rtAccelerationDestroy (RTacceleration acceleration)
 
RTresult RTAPI rtAccelerationValidate (RTacceleration acceleration)
 
RTresult RTAPI rtAccelerationGetContext (RTacceleration acceleration, RTcontext *context)
 
RTresult RTAPI rtAccelerationSetBuilder (RTacceleration acceleration, const char *builder)
 
RTresult RTAPI rtAccelerationGetBuilder (RTacceleration acceleration, const char **stringReturn)
 
RTresult RTAPI rtAccelerationSetTraverser (RTacceleration acceleration, const char *traverser)
 
RTresult RTAPI rtAccelerationGetTraverser (RTacceleration acceleration, const char **stringReturn)
 
RTresult RTAPI rtAccelerationSetProperty (RTacceleration acceleration, const char *name, const char *value)
 
RTresult RTAPI rtAccelerationGetProperty (RTacceleration acceleration, const char *name, const char **stringReturn)
 
RTresult RTAPI rtAccelerationGetDataSize (RTacceleration acceleration, RTsize *size)
 
RTresult RTAPI rtAccelerationGetData (RTacceleration acceleration, void *data)
 
RTresult RTAPI rtAccelerationSetData (RTacceleration acceleration, const void *data, RTsize size)
 
RTresult RTAPI rtAccelerationMarkDirty (RTacceleration acceleration)
 
RTresult RTAPI rtAccelerationIsDirty (RTacceleration acceleration, int *dirty)
 
RTresult RTAPI rtGeometryInstanceCreate (RTcontext context, RTgeometryinstance *geometryinstance)
 
RTresult RTAPI rtGeometryInstanceDestroy (RTgeometryinstance geometryinstance)
 
RTresult RTAPI rtGeometryInstanceValidate (RTgeometryinstance geometryinstance)
 
RTresult RTAPI rtGeometryInstanceGetContext (RTgeometryinstance geometryinstance, RTcontext *context)
 
RTresult RTAPI rtGeometryInstanceSetGeometry (RTgeometryinstance geometryinstance, RTgeometry geometry)
 
RTresult RTAPI rtGeometryInstanceGetGeometry (RTgeometryinstance geometryinstance, RTgeometry *geometry)
 
RTresult RTAPI rtGeometryInstanceSetGeometryTriangles (RTgeometryinstance geometryinstance, RTgeometrytriangles geometrytriangles)
 
RTresult RTAPI rtGeometryInstanceGetGeometryTriangles (RTgeometryinstance geometryinstance, RTgeometrytriangles *geometrytriangles)
 
RTresult RTAPI rtGeometryInstanceSetMaterialCount (RTgeometryinstance geometryinstance, unsigned int count)
 
RTresult RTAPI rtGeometryInstanceGetMaterialCount (RTgeometryinstance geometryinstance, unsigned int *count)
 
RTresult RTAPI rtGeometryInstanceSetMaterial (RTgeometryinstance geometryinstance, unsigned int index, RTmaterial material)
 
RTresult RTAPI rtGeometryInstanceGetMaterial (RTgeometryinstance geometryinstance, unsigned int index, RTmaterial *material)
 
RTresult RTAPI rtGeometryInstanceDeclareVariable (RTgeometryinstance geometryinstance, const char *name, RTvariable *v)
 
RTresult RTAPI rtGeometryInstanceQueryVariable (RTgeometryinstance geometryinstance, const char *name, RTvariable *v)
 
RTresult RTAPI rtGeometryInstanceRemoveVariable (RTgeometryinstance geometryinstance, RTvariable v)
 
RTresult RTAPI rtGeometryInstanceGetVariableCount (RTgeometryinstance geometryinstance, unsigned int *count)
 
RTresult RTAPI rtGeometryInstanceGetVariable (RTgeometryinstance geometryinstance, unsigned int index, RTvariable *v)
 
RTresult RTAPI rtGeometryCreate (RTcontext context, RTgeometry *geometry)
 
RTresult RTAPI rtGeometryDestroy (RTgeometry geometry)
 
RTresult RTAPI rtGeometryValidate (RTgeometry geometry)
 
RTresult RTAPI rtGeometryGetContext (RTgeometry geometry, RTcontext *context)
 
RTresult RTAPI rtGeometrySetPrimitiveCount (RTgeometry geometry, unsigned int primitiveCount)
 
RTresult RTAPI rtGeometryGetPrimitiveCount (RTgeometry geometry, unsigned int *primitiveCount)
 
RTresult RTAPI rtGeometrySetPrimitiveIndexOffset (RTgeometry geometry, unsigned int indexOffset)
 
RTresult RTAPI rtGeometryGetPrimitiveIndexOffset (RTgeometry geometry, unsigned int *indexOffset)
 
RTresult RTAPI rtGeometrySetMotionRange (RTgeometry geometry, float timeBegin, float timeEnd)
 
RTresult RTAPI rtGeometryGetMotionRange (RTgeometry geometry, float *timeBegin, float *timeEnd)
 
RTresult RTAPI rtGeometrySetMotionBorderMode (RTgeometry geometry, RTmotionbordermode beginMode, RTmotionbordermode endMode)
 
RTresult RTAPI rtGeometryGetMotionBorderMode (RTgeometry geometry, RTmotionbordermode *beginMode, RTmotionbordermode *endMode)
 
RTresult RTAPI rtGeometrySetMotionSteps (RTgeometry geometry, unsigned int n)
 
RTresult RTAPI rtGeometryGetMotionSteps (RTgeometry geometry, unsigned int *n)
 
RTresult RTAPI rtGeometrySetBoundingBoxProgram (RTgeometry geometry, RTprogram program)
 
RTresult RTAPI rtGeometryGetBoundingBoxProgram (RTgeometry geometry, RTprogram *program)
 
RTresult RTAPI rtGeometrySetIntersectionProgram (RTgeometry geometry, RTprogram program)
 
RTresult RTAPI rtGeometryGetIntersectionProgram (RTgeometry geometry, RTprogram *program)
 
RTresult RTAPI rtGeometrySetFlags (RTgeometry geometry, RTgeometryflags flags)
 
RTresult RTAPI rtGeometryGetFlags (RTgeometry geometry, RTgeometryflags *flags)
 
RTresult RTAPI rtGeometryMarkDirty (RTgeometry geometry)
 
RTresult RTAPI rtGeometryIsDirty (RTgeometry geometry, int *dirty)
 
RTresult RTAPI rtGeometryDeclareVariable (RTgeometry geometry, const char *name, RTvariable *v)
 
RTresult RTAPI rtGeometryQueryVariable (RTgeometry geometry, const char *name, RTvariable *v)
 
RTresult RTAPI rtGeometryRemoveVariable (RTgeometry geometry, RTvariable v)
 
RTresult RTAPI rtGeometryGetVariableCount (RTgeometry geometry, unsigned int *count)
 
RTresult RTAPI rtGeometryGetVariable (RTgeometry geometry, unsigned int index, RTvariable *v)
 
RTresult RTAPI rtGeometryTrianglesCreate (RTcontext context, RTgeometrytriangles *geometrytriangles)
 
RTresult RTAPI rtGeometryTrianglesDestroy (RTgeometrytriangles geometrytriangles)
 
RTresult RTAPI rtGeometryTrianglesValidate (RTgeometrytriangles geometrytriangles)
 
RTresult RTAPI rtGeometryTrianglesGetContext (RTgeometrytriangles geometrytriangles, RTcontext *context)
 
RTresult RTAPI rtGeometryTrianglesSetPrimitiveIndexOffset (RTgeometrytriangles geometrytriangles, unsigned int indexOffset)
 
RTresult RTAPI rtGeometryTrianglesGetPrimitiveIndexOffset (RTgeometrytriangles geometrytriangles, unsigned int *indexOffset)
 
RTresult RTAPI rtGeometryTrianglesSetPreTransformMatrix (RTgeometrytriangles geometrytriangles, int transpose, const float *matrix)
 
RTresult RTAPI rtGeometryTrianglesGetPreTransformMatrix (RTgeometrytriangles geometrytriangles, int transpose, float *matrix)
 
RTresult RTAPI rtGeometryTrianglesSetPrimitiveCount (RTgeometrytriangles geometrytriangles, unsigned int triangleCount)
 
RTresult RTAPI rtGeometryTrianglesGetPrimitiveCount (RTgeometrytriangles geometrytriangles, unsigned int *triangleCount)
 
RTresult RTAPI rtGeometryTrianglesSetTriangleIndices (RTgeometrytriangles geometrytriangles, RTbuffer indexBuffer, RTsize indexBufferByteOffset, RTsize triIndicesByteStride, RTformat triIndicesFormat)
 
RTresult RTAPI rtGeometryTrianglesSetVertices (RTgeometrytriangles geometrytriangles, unsigned int vertexCount, RTbuffer vertexBuffer, RTsize vertexBufferByteOffset, RTsize vertexByteStride, RTformat positionFormat)
 
RTresult RTAPI rtGeometryTrianglesSetMotionVertices (RTgeometrytriangles geometrytriangles, unsigned int vertexCount, RTbuffer vertexBuffer, RTsize vertexBufferByteOffset, RTsize vertexByteStride, RTsize vertexMotionStepByteStride, RTformat positionFormat)
 
RTresult RTAPI rtGeometryTrianglesSetMotionVerticesMultiBuffer (RTgeometrytriangles geometrytriangles, unsigned int vertexCount, RTbuffer *vertexBuffers, unsigned int vertexBufferCount, RTsize vertexBufferByteOffset, RTsize vertexByteStride, RTformat positionFormat)
 
RTresult RTAPI rtGeometryTrianglesSetMotionSteps (RTgeometrytriangles geometrytriangles, unsigned int motionStepCount)
 
RTresult RTAPI rtGeometryTrianglesGetMotionSteps (RTgeometrytriangles geometrytriangles, unsigned int *motionStepCount)
 
RTresult RTAPI rtGeometryTrianglesSetMotionRange (RTgeometrytriangles geometrytriangles, float timeBegin, float timeEnd)
 
RTresult RTAPI rtGeometryTrianglesGetMotionRange (RTgeometrytriangles geometrytriangles, float *timeBegin, float *timeEnd)
 
RTresult RTAPI rtGeometryTrianglesSetMotionBorderMode (RTgeometrytriangles geometrytriangles, RTmotionbordermode beginMode, RTmotionbordermode endMode)
 
RTresult RTAPI rtGeometryTrianglesGetMotionBorderMode (RTgeometrytriangles geometrytriangles, RTmotionbordermode *beginMode, RTmotionbordermode *endMode)
 
RTresult RTAPI rtGeometryTrianglesSetBuildFlags (RTgeometrytriangles geometrytriangles, RTgeometrybuildflags buildFlags)
 
RTresult RTAPI rtGeometryTrianglesGetMaterialCount (RTgeometrytriangles geometrytriangles, unsigned int *numMaterials)
 
RTresult RTAPI rtGeometryTrianglesSetMaterialCount (RTgeometrytriangles geometrytriangles, unsigned int numMaterials)
 
RTresult RTAPI rtGeometryTrianglesSetMaterialIndices (RTgeometrytriangles geometrytriangles, RTbuffer materialIndexBuffer, RTsize materialIndexBufferByteOffset, RTsize materialIndexByteStride, RTformat materialIndexFormat)
 
RTresult RTAPI rtGeometryTrianglesSetFlagsPerMaterial (RTgeometrytriangles geometrytriangles, unsigned int materialIndex, RTgeometryflags flags)
 
RTresult RTAPI rtGeometryTrianglesGetFlagsPerMaterial (RTgeometrytriangles triangles, unsigned int materialIndex, RTgeometryflags *flags)
 
RTresult RTAPI rtMaterialCreate (RTcontext context, RTmaterial *material)
 
RTresult RTAPI rtMaterialDestroy (RTmaterial material)
 
RTresult RTAPI rtMaterialValidate (RTmaterial material)
 
RTresult RTAPI rtMaterialGetContext (RTmaterial material, RTcontext *context)
 
RTresult RTAPI rtMaterialSetClosestHitProgram (RTmaterial material, unsigned int rayTypeIndex, RTprogram program)
 
RTresult RTAPI rtMaterialGetClosestHitProgram (RTmaterial material, unsigned int rayTypeIndex, RTprogram *program)
 
RTresult RTAPI rtMaterialSetAnyHitProgram (RTmaterial material, unsigned int rayTypeIndex, RTprogram program)
 
RTresult RTAPI rtMaterialGetAnyHitProgram (RTmaterial material, unsigned int rayTypeIndex, RTprogram *program)
 
RTresult RTAPI rtMaterialDeclareVariable (RTmaterial material, const char *name, RTvariable *v)
 
RTresult RTAPI rtMaterialQueryVariable (RTmaterial material, const char *name, RTvariable *v)
 
RTresult RTAPI rtMaterialRemoveVariable (RTmaterial material, RTvariable v)
 
RTresult RTAPI rtMaterialGetVariableCount (RTmaterial material, unsigned int *count)
 
RTresult RTAPI rtMaterialGetVariable (RTmaterial material, unsigned int index, RTvariable *v)
 
RTresult RTAPI rtTextureSamplerCreate (RTcontext context, RTtexturesampler *texturesampler)
 
RTresult RTAPI rtTextureSamplerDestroy (RTtexturesampler texturesampler)
 
RTresult RTAPI rtTextureSamplerValidate (RTtexturesampler texturesampler)
 
RTresult RTAPI rtTextureSamplerGetContext (RTtexturesampler texturesampler, RTcontext *context)
 
RTresult RTAPI rtTextureSamplerSetMipLevelCount (RTtexturesampler texturesampler, unsigned int mipLevelCount)
 
RTresult RTAPI rtTextureSamplerGetMipLevelCount (RTtexturesampler texturesampler, unsigned int *mipLevelCount)
 
RTresult RTAPI rtTextureSamplerSetArraySize (RTtexturesampler texturesampler, unsigned int textureCount)
 
RTresult RTAPI rtTextureSamplerGetArraySize (RTtexturesampler texturesampler, unsigned int *textureCount)
 
RTresult RTAPI rtTextureSamplerSetWrapMode (RTtexturesampler texturesampler, unsigned int dimension, RTwrapmode wrapmode)
 
RTresult RTAPI rtTextureSamplerGetWrapMode (RTtexturesampler texturesampler, unsigned int dimension, RTwrapmode *wrapmode)
 
RTresult RTAPI rtTextureSamplerSetFilteringModes (RTtexturesampler texturesampler, RTfiltermode minification, RTfiltermode magnification, RTfiltermode mipmapping)
 
RTresult RTAPI rtTextureSamplerGetFilteringModes (RTtexturesampler texturesampler, RTfiltermode *minification, RTfiltermode *magnification, RTfiltermode *mipmapping)
 
RTresult RTAPI rtTextureSamplerSetMaxAnisotropy (RTtexturesampler texturesampler, float value)
 
RTresult RTAPI rtTextureSamplerGetMaxAnisotropy (RTtexturesampler texturesampler, float *value)
 
RTresult RTAPI rtTextureSamplerSetMipLevelClamp (RTtexturesampler texturesampler, float minLevel, float maxLevel)
 
RTresult RTAPI rtTextureSamplerGetMipLevelClamp (RTtexturesampler texturesampler, float *minLevel, float *maxLevel)
 
RTresult RTAPI rtTextureSamplerSetMipLevelBias (RTtexturesampler texturesampler, float value)
 
RTresult RTAPI rtTextureSamplerGetMipLevelBias (RTtexturesampler texturesampler, float *value)
 
RTresult RTAPI rtTextureSamplerSetReadMode (RTtexturesampler texturesampler, RTtexturereadmode readmode)
 
RTresult RTAPI rtTextureSamplerGetReadMode (RTtexturesampler texturesampler, RTtexturereadmode *readmode)
 
RTresult RTAPI rtTextureSamplerSetIndexingMode (RTtexturesampler texturesampler, RTtextureindexmode indexmode)
 
RTresult RTAPI rtTextureSamplerGetIndexingMode (RTtexturesampler texturesampler, RTtextureindexmode *indexmode)
 
RTresult RTAPI rtTextureSamplerSetBuffer (RTtexturesampler texturesampler, unsigned int deprecated0, unsigned int deprecated1, RTbuffer buffer)
 
RTresult RTAPI rtTextureSamplerGetBuffer (RTtexturesampler texturesampler, unsigned int deprecated0, unsigned int deprecated1, RTbuffer *buffer)
 
RTresult RTAPI rtTextureSamplerGetId (RTtexturesampler texturesampler, int *textureId)
 
RTresult RTAPI rtBufferCreate (RTcontext context, unsigned int bufferdesc, RTbuffer *buffer)
 
RTresult RTAPI rtBufferDestroy (RTbuffer buffer)
 
RTresult RTAPI rtBufferValidate (RTbuffer buffer)
 
RTresult RTAPI rtBufferGetContext (RTbuffer buffer, RTcontext *context)
 
RTresult RTAPI rtBufferSetFormat (RTbuffer buffer, RTformat format)
 
RTresult RTAPI rtBufferGetFormat (RTbuffer buffer, RTformat *format)
 
RTresult RTAPI rtBufferSetElementSize (RTbuffer buffer, RTsize elementSize)
 
RTresult RTAPI rtBufferGetElementSize (RTbuffer buffer, RTsize *elementSize)
 
RTresult RTAPI rtBufferSetSize1D (RTbuffer buffer, RTsize width)
 
RTresult RTAPI rtBufferGetSize1D (RTbuffer buffer, RTsize *width)
 
RTresult RTAPI rtBufferSetSize2D (RTbuffer buffer, RTsize width, RTsize height)
 
RTresult RTAPI rtBufferGetSize2D (RTbuffer buffer, RTsize *width, RTsize *height)
 
RTresult RTAPI rtBufferSetSize3D (RTbuffer buffer, RTsize width, RTsize height, RTsize depth)
 
RTresult RTAPI rtBufferSetMipLevelCount (RTbuffer buffer, unsigned int levels)
 
RTresult RTAPI rtBufferGetSize3D (RTbuffer buffer, RTsize *width, RTsize *height, RTsize *depth)
 
RTresult RTAPI rtBufferGetMipLevelSize1D (RTbuffer buffer, unsigned int level, RTsize *width)
 
RTresult RTAPI rtBufferGetMipLevelSize2D (RTbuffer buffer, unsigned int level, RTsize *width, RTsize *height)
 
RTresult RTAPI rtBufferGetMipLevelSize3D (RTbuffer buffer, unsigned int level, RTsize *width, RTsize *height, RTsize *depth)
 
RTresult RTAPI rtBufferSetSizev (RTbuffer buffer, unsigned int dimensionality, const RTsize *dims)
 
RTresult RTAPI rtBufferGetSizev (RTbuffer buffer, unsigned int dimensionality, RTsize *dims)
 
RTresult RTAPI rtBufferGetDimensionality (RTbuffer buffer, unsigned int *dimensionality)
 
RTresult RTAPI rtBufferGetMipLevelCount (RTbuffer buffer, unsigned int *level)
 
RTresult RTAPI rtBufferMap (RTbuffer buffer, void **userPointer)
 
RTresult RTAPI rtBufferUnmap (RTbuffer buffer)
 
RTresult RTAPI rtBufferMapEx (RTbuffer buffer, unsigned int mapFlags, unsigned int level, void *userOwned, void **optixOwned)
 
RTresult RTAPI rtBufferUnmapEx (RTbuffer buffer, unsigned int level)
 
RTresult RTAPI rtBufferGetId (RTbuffer buffer, int *bufferId)
 
RTresult RTAPI rtContextGetBufferFromId (RTcontext context, int bufferId, RTbuffer *buffer)
 
RTresult RTAPI rtBufferGetProgressiveUpdateReady (RTbuffer buffer, int *ready, unsigned int *subframeCount, unsigned int *maxSubframes)
 
RTresult RTAPI rtBufferBindProgressiveStream (RTbuffer stream, RTbuffer source)
 
RTresult RTAPI rtBufferSetAttribute (RTbuffer buffer, RTbufferattribute attrib, RTsize size, const void *p)
 
RTresult RTAPI rtBufferGetAttribute (RTbuffer buffer, RTbufferattribute attrib, RTsize size, void *p)
 
RTresult RTAPI rtPostProcessingStageCreateBuiltin (RTcontext context, const char *builtinName, RTpostprocessingstage *stage)
 
RTresult RTAPI rtPostProcessingStageDestroy (RTpostprocessingstage stage)
 
RTresult RTAPI rtPostProcessingStageDeclareVariable (RTpostprocessingstage stage, const char *name, RTvariable *v)
 
RTresult RTAPI rtPostProcessingStageGetContext (RTpostprocessingstage stage, RTcontext *context)
 
RTresult RTAPI rtPostProcessingStageQueryVariable (RTpostprocessingstage stage, const char *name, RTvariable *variable)
 
RTresult RTAPI rtPostProcessingStageGetVariableCount (RTpostprocessingstage stage, unsigned int *count)
 
RTresult RTAPI rtPostProcessingStageGetVariable (RTpostprocessingstage stage, unsigned int index, RTvariable *variable)
 
RTresult RTAPI rtCommandListCreate (RTcontext context, RTcommandlist *list)
 
RTresult RTAPI rtCommandListDestroy (RTcommandlist list)
 
RTresult RTAPI rtCommandListAppendPostprocessingStage (RTcommandlist list, RTpostprocessingstage stage, RTsize launchWidth, RTsize launchHeight)
 
RTresult RTAPI rtCommandListAppendLaunch2D (RTcommandlist list, unsigned int entryPointIndex, RTsize launchWidth, RTsize launchHeight)
 
RTresult RTAPI rtCommandListFinalize (RTcommandlist list)
 
RTresult RTAPI rtCommandListExecute (RTcommandlist list)
 
RTresult RTAPI rtCommandListGetContext (RTcommandlist list, RTcontext *context)
 
RTresult RTAPI rtGeometryTrianglesSetAttributeProgram (RTgeometrytriangles geometrytriangles, RTprogram program)
 
RTresult RTAPI rtGeometryTrianglesGetAttributeProgram (RTgeometrytriangles geometrytriangles, RTprogram *program)
 
RTresult RTAPI rtGeometryTrianglesDeclareVariable (RTgeometrytriangles geometrytriangles, const char *name, RTvariable *v)
 
RTresult RTAPI rtGeometryTrianglesQueryVariable (RTgeometrytriangles geometrytriangles, const char *name, RTvariable *v)
 
RTresult RTAPI rtGeometryTrianglesRemoveVariable (RTgeometrytriangles geometrytriangles, RTvariable v)
 
RTresult RTAPI rtGeometryTrianglesGetVariableCount (RTgeometrytriangles geometrytriangles, unsigned int *count)
 
RTresult RTAPI rtGeometryTrianglesGetVariable (RTgeometrytriangles geometrytriangles, unsigned int index, RTvariable *v)
 
RTresult RTAPI rtVariableSet1f (RTvariable v, float f1)
 
RTresult RTAPI rtVariableSet2f (RTvariable v, float f1, float f2)
 
RTresult RTAPI rtVariableSet3f (RTvariable v, float f1, float f2, float f3)
 
RTresult RTAPI rtVariableSet4f (RTvariable v, float f1, float f2, float f3, float f4)
 
RTresult RTAPI rtVariableSet1fv (RTvariable v, const float *f)
 
RTresult RTAPI rtVariableSet2fv (RTvariable v, const float *f)
 
RTresult RTAPI rtVariableSet3fv (RTvariable v, const float *f)
 
RTresult RTAPI rtVariableSet4fv (RTvariable v, const float *f)
 
RTresult RTAPI rtVariableSet1i (RTvariable v, int i1)
 
RTresult RTAPI rtVariableSet2i (RTvariable v, int i1, int i2)
 
RTresult RTAPI rtVariableSet3i (RTvariable v, int i1, int i2, int i3)
 
RTresult RTAPI rtVariableSet4i (RTvariable v, int i1, int i2, int i3, int i4)
 
RTresult RTAPI rtVariableSet1iv (RTvariable v, const int *i)
 
RTresult RTAPI rtVariableSet2iv (RTvariable v, const int *i)
 
RTresult RTAPI rtVariableSet3iv (RTvariable v, const int *i)
 
RTresult RTAPI rtVariableSet4iv (RTvariable v, const int *i)
 
RTresult RTAPI rtVariableSet1ui (RTvariable v, unsigned int u1)
 
RTresult RTAPI rtVariableSet2ui (RTvariable v, unsigned int u1, unsigned int u2)
 
RTresult RTAPI rtVariableSet3ui (RTvariable v, unsigned int u1, unsigned int u2, unsigned int u3)
 
RTresult RTAPI rtVariableSet4ui (RTvariable v, unsigned int u1, unsigned int u2, unsigned int u3, unsigned int u4)
 
RTresult RTAPI rtVariableSet1uiv (RTvariable v, const unsigned int *u)
 
RTresult RTAPI rtVariableSet2uiv (RTvariable v, const unsigned int *u)
 
RTresult RTAPI rtVariableSet3uiv (RTvariable v, const unsigned int *u)
 
RTresult RTAPI rtVariableSet4uiv (RTvariable v, const unsigned int *u)
 
RTresult RTAPI rtVariableSet1ll (RTvariable v, long long ll1)
 
RTresult RTAPI rtVariableSet2ll (RTvariable v, long long ll1, long long ll2)
 
RTresult RTAPI rtVariableSet3ll (RTvariable v, long long ll1, long long ll2, long long ll3)
 
RTresult RTAPI rtVariableSet4ll (RTvariable v, long long ll1, long long ll2, long long ll3, long long ll4)
 
RTresult RTAPI rtVariableSet1llv (RTvariable v, const long long *ll)
 
RTresult RTAPI rtVariableSet2llv (RTvariable v, const long long *ll)
 
RTresult RTAPI rtVariableSet3llv (RTvariable v, const long long *ll)
 
RTresult RTAPI rtVariableSet4llv (RTvariable v, const long long *ll)
 
RTresult RTAPI rtVariableSet1ull (RTvariable v, unsigned long long ull1)
 
RTresult RTAPI rtVariableSet2ull (RTvariable v, unsigned long long ull1, unsigned long long ull2)
 
RTresult RTAPI rtVariableSet3ull (RTvariable v, unsigned long long ull1, unsigned long long ull2, unsigned long long ull3)
 
RTresult RTAPI rtVariableSet4ull (RTvariable v, unsigned long long ull1, unsigned long long ull2, unsigned long long ull3, unsigned long long ull4)
 
RTresult RTAPI rtVariableSet1ullv (RTvariable v, const unsigned long long *ull)
 
RTresult RTAPI rtVariableSet2ullv (RTvariable v, const unsigned long long *ull)
 
RTresult RTAPI rtVariableSet3ullv (RTvariable v, const unsigned long long *ull)
 
RTresult RTAPI rtVariableSet4ullv (RTvariable v, const unsigned long long *ull)
 
RTresult RTAPI rtVariableSetMatrix2x2fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableSetMatrix2x3fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableSetMatrix2x4fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableSetMatrix3x2fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableSetMatrix3x3fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableSetMatrix3x4fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableSetMatrix4x2fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableSetMatrix4x3fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableSetMatrix4x4fv (RTvariable v, int transpose, const float *m)
 
RTresult RTAPI rtVariableGet1f (RTvariable v, float *f1)
 
RTresult RTAPI rtVariableGet2f (RTvariable v, float *f1, float *f2)
 
RTresult RTAPI rtVariableGet3f (RTvariable v, float *f1, float *f2, float *f3)
 
RTresult RTAPI rtVariableGet4f (RTvariable v, float *f1, float *f2, float *f3, float *f4)
 
RTresult RTAPI rtVariableGet1fv (RTvariable v, float *f)
 
RTresult RTAPI rtVariableGet2fv (RTvariable v, float *f)
 
RTresult RTAPI rtVariableGet3fv (RTvariable v, float *f)
 
RTresult RTAPI rtVariableGet4fv (RTvariable v, float *f)
 
RTresult RTAPI rtVariableGet1i (RTvariable v, int *i1)
 
RTresult RTAPI rtVariableGet2i (RTvariable v, int *i1, int *i2)
 
RTresult RTAPI rtVariableGet3i (RTvariable v, int *i1, int *i2, int *i3)
 
RTresult RTAPI rtVariableGet4i (RTvariable v, int *i1, int *i2, int *i3, int *i4)
 
RTresult RTAPI rtVariableGet1iv (RTvariable v, int *i)
 
RTresult RTAPI rtVariableGet2iv (RTvariable v, int *i)
 
RTresult RTAPI rtVariableGet3iv (RTvariable v, int *i)
 
RTresult RTAPI rtVariableGet4iv (RTvariable v, int *i)
 
RTresult RTAPI rtVariableGet1ui (RTvariable v, unsigned int *u1)
 
RTresult RTAPI rtVariableGet2ui (RTvariable v, unsigned int *u1, unsigned int *u2)
 
RTresult RTAPI rtVariableGet3ui (RTvariable v, unsigned int *u1, unsigned int *u2, unsigned int *u3)
 
RTresult RTAPI rtVariableGet4ui (RTvariable v, unsigned int *u1, unsigned int *u2, unsigned int *u3, unsigned int *u4)
 
RTresult RTAPI rtVariableGet1uiv (RTvariable v, unsigned int *u)
 
RTresult RTAPI rtVariableGet2uiv (RTvariable v, unsigned int *u)
 
RTresult RTAPI rtVariableGet3uiv (RTvariable v, unsigned int *u)
 
RTresult RTAPI rtVariableGet4uiv (RTvariable v, unsigned int *u)
 
RTresult RTAPI rtVariableGet1ll (RTvariable v, long long *ll1)
 
RTresult RTAPI rtVariableGet2ll (RTvariable v, long long *ll1, long long *ll2)
 
RTresult RTAPI rtVariableGet3ll (RTvariable v, long long *ll1, long long *ll2, long long *ll3)
 
RTresult RTAPI rtVariableGet4ll (RTvariable v, long long *ll1, long long *ll2, long long *ll3, long long *ll4)
 
RTresult RTAPI rtVariableGet1llv (RTvariable v, long long *ll)
 
RTresult RTAPI rtVariableGet2llv (RTvariable v, long long *ll)
 
RTresult RTAPI rtVariableGet3llv (RTvariable v, long long *ll)
 
RTresult RTAPI rtVariableGet4llv (RTvariable v, long long *ll)
 
RTresult RTAPI rtVariableGet1ull (RTvariable v, unsigned long long *u1)
 
RTresult RTAPI rtVariableGet2ull (RTvariable v, unsigned long long *u1, unsigned long long *u2)
 
RTresult RTAPI rtVariableGet3ull (RTvariable v, unsigned long long *u1, unsigned long long *u2, unsigned long long *u3)
 
RTresult RTAPI rtVariableGet4ull (RTvariable v, unsigned long long *u1, unsigned long long *u2, unsigned long long *u3, unsigned long long *u4)
 
RTresult RTAPI rtVariableGet1ullv (RTvariable v, unsigned long long *ull)
 
RTresult RTAPI rtVariableGet2ullv (RTvariable v, unsigned long long *ull)
 
RTresult RTAPI rtVariableGet3ullv (RTvariable v, unsigned long long *ull)
 
RTresult RTAPI rtVariableGet4ullv (RTvariable v, unsigned long long *ull)
 
RTresult RTAPI rtVariableGetMatrix2x2fv (RTvariable v, int transpose, float *m)
 
RTresult RTAPI rtVariableGetMatrix2x3fv (RTvariable v, int transpose, float *m)
 
RTresult RTAPI rtVariableGetMatrix2x4fv (RTvariable v, int transpose, float *m)
 
RTresult RTAPI rtVariableGetMatrix3x2fv (RTvariable v, int transpose, float *m)
 
RTresult RTAPI rtVariableGetMatrix3x3fv (RTvariable v, int transpose, float *m)
 
RTresult RTAPI rtVariableGetMatrix3x4fv (RTvariable v, int transpose, float *m)
 
RTresult RTAPI rtVariableGetMatrix4x2fv (RTvariable v, int transpose, float *m)
 
RTresult RTAPI rtVariableGetMatrix4x3fv (RTvariable v, int transpose, float *m)
 
RTresult RTAPI rtVariableGetMatrix4x4fv (RTvariable v, int transpose, float *m)
 

Detailed Description

OptiX public API.

Author
NVIDIA Corporation OptiX public API Reference - Host side

Typedef Documentation

typedef struct RTacceleration_api* RTacceleration
Opaque type to handle Acceleration Structures - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTbuffer_api* RTbuffer
Opaque type to handle Buffers - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTcommandlist_api* RTcommandlist
Opaque type to handle CommandList - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTcontext_api* RTcontext
Opaque type to handle Contexts - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTgeometry_api* RTgeometry
Opaque type to handle Geometry - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTgeometrygroup_api* RTgeometrygroup
Opaque type to handle Geometry Group - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTgeometryinstance_api* RTgeometryinstance
Opaque type to handle Geometry Instance - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTgeometrytriangles_api* RTgeometrytriangles
Opaque type to handle GeometryTriangles - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTgroup_api* RTgroup
Opaque type to handle Group - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTmaterial_api* RTmaterial
Opaque type to handle Material - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef void* RTobject
Opaque type to handle Object - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTpostprocessingstage_api* RTpostprocessingstage
Opaque type to handle PostprocessingStage - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTprogram_api* RTprogram
Opaque type to handle Program - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTselector_api* RTselector
Opaque type to handle Selector - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef struct RTtexturesampler_api* RTtexturesampler
Opaque type to handle Texture Sampler - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef int(* RTtimeoutcallback)(void)

Callback signature for use with rtContextSetTimeoutCallback. Deprecated in OptiX 6.0.

typedef struct RTtransform_api* RTtransform
Opaque type to handle Transform - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

typedef void(* RTusagereportcallback)(int, const char *, const char *, void *)

Callback signature for use with rtContextSetUsageReportCallback.

typedef struct RTvariable_api* RTvariable
Opaque type to handle Variable - Note that the *_api type should never be used directly.

Only the typedef target name will be guaranteed to remain unchanged

Function Documentation

RTresult RTAPI rtAccelerationCreate ( RTcontext  context,
RTacceleration acceleration 
)

Creates a new acceleration structure.

Description

rtAccelerationCreate creates a new ray tracing acceleration structure within a context. An acceleration structure is used by attaching it to a group or geometry group by calling rtGroupSetAcceleration or rtGeometryGroupSetAcceleration. Note that an acceleration structure can be shared by attaching it to multiple groups or geometry groups if the underlying geometric structures are the same, see rtGroupSetAcceleration and rtGeometryGroupSetAcceleration for more details. A newly created acceleration structure is initially in dirty state. Sets *acceleration to the handle of a newly created acceleration structure within context. Returns RT_ERROR_INVALID_VALUE if acceleration is NULL.

Parameters
[in]contextSpecifies a context within which to create a new acceleration structure
[out]accelerationReturns the newly created acceleration structure

Return values

Relevant return values:

History

rtAccelerationCreate was introduced in OptiX 1.0.

See also rtAccelerationDestroy, rtContextCreate, rtAccelerationMarkDirty, rtAccelerationIsDirty, rtGroupSetAcceleration, rtGeometryGroupSetAcceleration

RTresult RTAPI rtAccelerationDestroy ( RTacceleration  acceleration)

Destroys an acceleration structure object.

Description

rtAccelerationDestroy removes acceleration from its context and deletes it. acceleration should be a value returned by rtAccelerationCreate. After the call, acceleration is no longer a valid handle.

Parameters
[in]accelerationHandle of the acceleration structure to destroy

Return values

Relevant return values:

History

rtAccelerationDestroy was introduced in OptiX 1.0.

See also rtAccelerationCreate

RTresult RTAPI rtAccelerationGetBuilder ( RTacceleration  acceleration,
const char **  stringReturn 
)

Query the current builder from an acceleration structure.

Description

rtAccelerationGetBuilder returns the name of the builder currently used in the acceleration structure acceleration. If no builder has been set for acceleration, an empty string is returned. stringReturn will be set to point to the returned string. The memory stringReturn points to will be valid until the next API call that returns a string.

Parameters
[in]accelerationThe acceleration structure handle
[out]stringReturnReturn string buffer

Return values

Relevant return values:

History

rtAccelerationGetBuilder was introduced in OptiX 1.0.

See also rtAccelerationSetBuilder

RTresult RTAPI rtAccelerationGetContext ( RTacceleration  acceleration,
RTcontext context 
)

Returns the context associated with an acceleration structure.

Description

rtAccelerationGetContext queries an acceleration structure for its associated context. The context handle is returned in *context.

Parameters
[in]accelerationThe acceleration structure handle
[out]contextReturns the context associated with the acceleration structure

Return values

Relevant return values:

History

rtAccelerationGetContext was introduced in OptiX 1.0.

See also rtAccelerationCreate

RTresult RTAPI rtAccelerationGetData ( RTacceleration  acceleration,
void *  data 
)

Deprecated in OptiX 4.0. Should not be called.

RTresult RTAPI rtAccelerationGetDataSize ( RTacceleration  acceleration,
RTsize *  size 
)

Deprecated in OptiX 4.0. Should not be called.

RTresult RTAPI rtAccelerationGetProperty ( RTacceleration  acceleration,
const char *  name,
const char **  stringReturn 
)

Queries an acceleration structure property.

Description

rtAccelerationGetProperty returns the value of the acceleration structure property name. See rtAccelerationSetProperty for a list of supported properties. If the property name is not found, an empty string is returned. stringReturn will be set to point to the returned string. The memory stringReturn points to will be valid until the next API call that returns a string.

Parameters
[in]accelerationThe acceleration structure handle
[in]nameThe name of the property to be queried
[out]stringReturnReturn string buffer

Return values

Relevant return values:

History

rtAccelerationGetProperty was introduced in OptiX 1.0.

See also rtAccelerationSetProperty, rtAccelerationSetBuilder,

RTresult RTAPI rtAccelerationGetTraverser ( RTacceleration  acceleration,
const char **  stringReturn 
)

Deprecated in OptiX 4.0.

RTresult RTAPI rtAccelerationIsDirty ( RTacceleration  acceleration,
int *  dirty 
)

Returns the dirty flag of an acceleration structure.

Description

rtAccelerationIsDirty returns whether the acceleration structure is currently marked dirty. If the flag is set, a nonzero value will be returned in *dirty. Otherwise, zero is returned.

Any acceleration structure which is marked dirty will be rebuilt on a call to one of the rtContextLaunch functions, and its dirty flag will be reset.

An acceleration structure which is not marked dirty will never be rebuilt, even if associated groups, geometry, properties, or any other values have changed.

Initially after creation, acceleration structures are marked dirty.

Parameters
[in]accelerationThe acceleration structure handle
[out]dirtyReturned dirty flag

Return values

Relevant return values:

History

rtAccelerationIsDirty was introduced in OptiX 1.0.

See also rtAccelerationMarkDirty, rtContextLaunch

RTresult RTAPI rtAccelerationMarkDirty ( RTacceleration  acceleration)

Marks an acceleration structure as dirty.

Description

rtAccelerationMarkDirty sets the dirty flag for acceleration.

Any acceleration structure which is marked dirty will be rebuilt on a call to one of the rtContextLaunch functions, and its dirty flag will be reset.

An acceleration structure which is not marked dirty will never be rebuilt, even if associated groups, geometry, properties, or any other values have changed.

Initially after creation, acceleration structures are marked dirty.

Parameters
[in]accelerationThe acceleration structure handle

Return values

Relevant return values:

History

rtAccelerationMarkDirty was introduced in OptiX 1.0.

See also rtAccelerationIsDirty, rtContextLaunch

RTresult RTAPI rtAccelerationSetBuilder ( RTacceleration  acceleration,
const char *  builder 
)

Specifies the builder to be used for an acceleration structure.

Description

rtAccelerationSetBuilder specifies the method used to construct the ray tracing acceleration structure represented by acceleration. A builder must be set for the acceleration structure to pass validation. The current builder can be changed at any time, including after a call to rtContextLaunch. In this case, data previously computed for the acceleration structure is invalidated and the acceleration will be marked dirty.

builder can take one of the following values:

  • "NoAccel": Specifies that no acceleration structure is explicitly built. Traversal linearly loops through the list of primitives to intersect. This can be useful e.g. for higher level groups with only few children, where managing a more complex structure introduces unnecessary overhead.
  • "Bvh": A standard bounding volume hierarchy, useful for most types of graph levels and geometry. Medium build speed, good ray tracing performance.
  • "Sbvh": A high quality BVH variant for maximum ray tracing performance. Slower build speed and slightly higher memory footprint than "Bvh".
  • "Trbvh": High quality similar to Sbvh but with fast build performance. The Trbvh builder uses about 2.5 times the size of the final BVH for scratch space. A CPU-based Trbvh builder that does not have the memory constraints is available. OptiX includes an optional automatic fallback to the CPU version when out of GPU memory. Please refer to the Programming Guide for more details. Supports motion blur.
  • "MedianBvh": Deprecated in OptiX 4.0. This builder is now internally remapped to Trbvh.
  • "Lbvh": Deprecated in OptiX 4.0. This builder is now internally remapped to Trbvh.
  • "TriangleKdTree": Deprecated in OptiX 4.0. This builder is now internally remapped to Trbvh.
Parameters
[in]accelerationThe acceleration structure handle
[in]builderString value specifying the builder type

Return values

Relevant return values:

History

rtAccelerationSetBuilder was introduced in OptiX 1.0.

See also rtAccelerationGetBuilder, rtAccelerationSetProperty

RTresult RTAPI rtAccelerationSetData ( RTacceleration  acceleration,
const void *  data,
RTsize  size 
)

Deprecated in OptiX 4.0. Should not be called.

RTresult RTAPI rtAccelerationSetProperty ( RTacceleration  acceleration,
const char *  name,
const char *  value 
)

Sets an acceleration structure property.

Description

rtAccelerationSetProperty sets a named property value for an acceleration structure. Properties can be used to fine tune the way an acceleration structure is built, in order to achieve faster build times or better ray tracing performance. Properties are evaluated and applied by the acceleration structure during build time, and different builders recognize different properties. Setting a property will never fail as long as acceleration is a valid handle. Properties that are not recognized by an acceleration structure will be ignored.

The following is a list of the properties used by the individual builders:

  • "refit": Available in: Trbvh, Bvh If set to "1", the builder will only readjust the node bounds of the bounding volume hierarchy instead of constructing it from scratch. Refit is only effective if there is an initial BVH already in place, and the underlying geometry has undergone relatively modest deformation. In this case, the builder delivers a very fast BVH update without sacrificing too much ray tracing performance. The default is "0".
  • "vertex_buffer_name": Available in: Trbvh, Sbvh The name of the buffer variable holding triangle vertex data. Each vertex consists of 3 floats. The default is "vertex_buffer".
  • "vertex_buffer_stride": Available in: Trbvh, Sbvh The offset between two vertices in the vertex buffer, given in bytes. The default value is "0", which assumes the vertices are tightly packed.
  • "index_buffer_name": Available in: Trbvh, Sbvh The name of the buffer variable holding vertex index data. The entries in this buffer are indices of type int, where each index refers to one entry in the vertex buffer. A sequence of three indices represents one triangle. If no index buffer is given, the vertices in the vertex buffer are assumed to be a list of triangles, i.e. every 3 vertices in a row form a triangle. The default is "index_buffer".
  • "index_buffer_stride": Available in: Trbvh, Sbvh The offset between two indices in the index buffer, given in bytes. The default value is "0", which assumes the indices are tightly packed.
  • "chunk_size": Available in: Trbvh Number of bytes to be used for a partitioned acceleration structure build. If no chunk size is set, or set to "0", the chunk size is chosen automatically. If set to "-1", the chunk size is unlimited. The minimum chunk size is 64MB. Please note that specifying a small chunk size reduces the peak-memory footprint of the Trbvh but can result in slower rendering performance.
  • " motion_steps" Available in: Trbvh Number of motion steps to build into an acceleration structure that contains motion geometry or motion transforms. Ignored for acceleration structures built over static nodes. Gives a tradeoff between device memory and time: if the input geometry or transforms have many motion steps, then increasing the motion steps in the acceleration structure may result in faster traversal, at the cost of linear increase in memory usage. Default 2, and clamped >=1.
Parameters
[in]accelerationThe acceleration structure handle
[in]nameString value specifying the name of the property
[in]valueString value specifying the value of the property

Return values

Relevant return values:

History

rtAccelerationSetProperty was introduced in OptiX 1.0.

See also rtAccelerationGetProperty, rtAccelerationSetBuilder,

RTresult RTAPI rtAccelerationSetTraverser ( RTacceleration  acceleration,
const char *  traverser 
)

Deprecated in OptiX 4.0. Setting a traverser is no longer necessary and will be ignored.

RTresult RTAPI rtAccelerationValidate ( RTacceleration  acceleration)

Validates the state of an acceleration structure.

Description

rtAccelerationValidate checks acceleration for completeness. If acceleration is not valid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]accelerationThe acceleration structure handle

Return values

Relevant return values:

History

rtAccelerationValidate was introduced in OptiX 1.0.

See also rtAccelerationCreate

RTresult RTAPI rtBufferBindProgressiveStream ( RTbuffer  stream,
RTbuffer  source 
)

Bind a stream buffer to an output buffer source.

Description

Binds an output buffer to a progressive stream. The output buffer thereby becomes the data source for the stream. To form a valid output/stream pair, the stream buffer must be of format RT_FORMAT_UNSIGNED_BYTE4, and the output buffer must be of format RT_FORMAT_FLOAT3 or RT_FORMAT_FLOAT4. The use of RT_FORMAT_FLOAT4 is recommended for performance reasons, even if the fourth component is unused. The output buffer must be of type RT_BUFFER_OUTPUT; it may not be of type RT_BUFFER_INPUT_OUTPUT.

Parameters
[in]streamThe stream buffer for which the source is to be specified
[in]sourceThe output buffer to function as the stream's source

Return values

Relevant return values:

History

rtBufferBindProgressiveStream was introduced in OptiX 3.8.

See also rtBufferCreate rtBufferSetAttribute rtBufferGetAttribute

RTresult RTAPI rtBufferCreate ( RTcontext  context,
unsigned int  bufferdesc,
RTbuffer buffer 
)

Creates a new buffer object.

Description

rtBufferCreate allocates and returns a new handle to a new buffer object in *buffer associated with context. The backing storage of the buffer is managed by OptiX. A buffer is specified by a bitwise or combination of a type and flags in bufferdesc. The supported types are:

The type values are used to specify the direction of data flow from the host to the OptiX devices. RT_BUFFER_INPUT specifies that the host may only write to the buffer and the device may only read from the buffer. RT_BUFFER_OUTPUT specifies the opposite, read only access on the host and write only access on the device. Devices and the host may read and write from buffers of type RT_BUFFER_INPUT_OUTPUT. Reading or writing to a buffer of the incorrect type (e.g., the host writing to a buffer of type RT_BUFFER_OUTPUT) is undefined. RT_BUFFER_PROGRESSIVE_STREAM is used to receive stream updates generated by progressive launches (see rtContextLaunchProgressive2D).

The supported flags are:

If RT_BUFFER_LAYERED flag is set, buffer depth specifies the number of layers, not the depth of a 3D buffer. If RT_BUFFER_CUBEMAP flag is set, buffer depth specifies the number of cube faces, not the depth of a 3D buffer. See details in rtBufferSetSize3D

Flags can be used to optimize data transfers between the host and its devices. The flag RT_BUFFER_GPU_LOCAL can only be used in combination with RT_BUFFER_INPUT_OUTPUT. RT_BUFFER_INPUT_OUTPUT and RT_BUFFER_GPU_LOCAL used together specify a buffer that allows the host to only write, and the device to read and write data. The written data will never be visible on the host side and will generally not be visible on other devices.

If rtBufferGetDevicePointer has been called for a single device for a given buffer, the user can change the buffer's content on that device through the pointer. OptiX must then synchronize the new buffer contents to all devices. These synchronization copies occur at every rtContextLaunch, unless the buffer is created with RT_BUFFER_COPY_ON_DIRTY. In this case, rtBufferMarkDirty can be used to notify OptiX that the buffer has been dirtied and must be synchronized.

The flag RT_BUFFER_DISCARD_HOST_MEMORY can only be used in combination with RT_BUFFER_INPUT. The data will be synchronized to the devices as soon as the buffer is unmapped from the host using rtBufferUnmap or rtBufferUnmapEx and the memory allocated on the host will be deallocated. It is preferred to map buffers created with the RT_BUFFER_DISCARD_HOST_MEMORY using rtBufferMapEx with the RT_BUFFER_MAP_WRITE_DISCARD option enabled. If it is mapped using rtBufferMap or the RT_BUFFER_MAP_WRITE option instead, the data needs to be synchronized to the host during mapping. Note that the data that is allocated on the devices will not be deallocated until the buffer is destroyed.

Returns RT_ERROR_INVALID_VALUE if buffer is NULL.

Parameters
[in]contextThe context to create the buffer in
[in]bufferdescBitwise or combination of the type and flags of the new buffer
[out]bufferThe return handle for the buffer object

Return values

Relevant return values:

History

rtBufferCreate was introduced in OptiX 1.0.

RT_BUFFER_GPU_LOCAL was introduced in OptiX 2.0.

See also rtBufferCreateFromGLBO, rtBufferDestroy, rtBufferMarkDirty rtBufferBindProgressiveStream

RTresult RTAPI rtBufferDestroy ( RTbuffer  buffer)

Destroys a buffer object.

Description

rtBufferDestroy removes buffer from its context and deletes it. buffer should be a value returned by rtBufferCreate. After the call, buffer is no longer a valid handle. Any API object that referenced buffer will have its reference invalidated.

Parameters
[in]bufferHandle of the buffer to destroy

Return values

Relevant return values:

History

rtBufferDestroy was introduced in OptiX 1.0.

See also rtBufferCreate, rtBufferCreateFromGLBO

RTresult RTAPI rtBufferGetAttribute ( RTbuffer  buffer,
RTbufferattribute  attrib,
RTsize  size,
void *  p 
)

Query a buffer attribute.

Description

rtBufferGetAttribute is used to query buffer attributes. For a list of available attributes, please refer to rtBufferSetAttribute.

Parameters
[in]bufferThe buffer to query the attribute from
[in]attribThe attribute to query
[in]sizeThe size of the attribute value, in bytes. For string attributes, this is the maximum buffer size the returned string will use (including a terminating null character).
[out]pPointer to the attribute value to be filled in. Must point to valid memory of at least size bytes.

Return values

Relevant return values:

History

rtBufferGetAttribute was introduced in OptiX 3.8.

See also rtBufferSetAttribute

RTresult RTAPI rtBufferGetContext ( RTbuffer  buffer,
RTcontext context 
)

Returns the context object that created this buffer.

Description

rtBufferGetContext returns a handle to the context that created buffer in *context. If *context is NULL, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]bufferThe buffer to be queried for its context
[out]contextThe return handle for the buffer's context

Return values

Relevant return values:

History

rtBufferGetContext was introduced in OptiX 1.0.

See also rtContextCreate

RTresult RTAPI rtBufferGetDimensionality ( RTbuffer  buffer,
unsigned int *  dimensionality 
)

Gets the dimensionality of this buffer object.

Description

rtBufferGetDimensionality returns the dimensionality of buffer in *dimensionality. The value returned will be one of 1, 2 or 3, corresponding to 1D, 2D and 3D buffers, respectively.

Parameters
[in]bufferThe buffer to be queried for its dimensionality
[out]dimensionalityThe return handle for the buffer's dimensionality

Return values

Relevant return values:

History

rtBufferGetDimensionality was introduced in OptiX 1.0.

See also rtBufferSetSize{1-2-3}D

RTresult RTAPI rtBufferGetElementSize ( RTbuffer  buffer,
RTsize *  elementSize 
)

Returns the size of a buffer's individual elements.

Description

rtBufferGetElementSize queries the size of a buffer's elements. The target buffer is specified by buffer, which should be a value returned by rtBufferCreate. The size, in bytes, of the buffer's individual elements is returned in *elementSize. Returns RT_ERROR_INVALID_VALUE if given a NULL pointer.

Parameters
[in]bufferSpecifies the buffer to be queried
[out]elementSizeReturns the size of the buffer's individual elements

Return values

Relevant return values:

History

rtBufferGetElementSize was introduced in OptiX 1.0.

See also rtBufferSetElementSize, rtBufferCreate

RTresult RTAPI rtBufferGetFormat ( RTbuffer  buffer,
RTformat format 
)

Gets the format of this buffer.

Description

rtBufferGetFormat returns, in *format, the format of buffer. See rtBufferSetFormat for a listing of RTbuffer values.

Parameters
[in]bufferThe buffer to be queried for its format
[out]formatThe return handle for the buffer's format

Return values

Relevant return values:

History

rtBufferGetFormat was introduced in OptiX 1.0.

See also rtBufferSetFormat, rtBufferGetFormat

RTresult RTAPI rtBufferGetId ( RTbuffer  buffer,
int *  bufferId 
)

Gets an id suitable for use with buffers of buffers.

Description

rtBufferGetId returns an ID for the provided buffer. The returned ID is used on the device to reference the buffer. It needs to be copied into a buffer of type RT_FORMAT_BUFFER_ID or used in a rtBufferId object.. If *bufferId is NULL or the buffer is not a valid RTbuffer, returns RT_ERROR_INVALID_VALUE. RT_BUFFER_ID_NULL can be used as a sentinel for a non-existent buffer, since this value will never be returned as a valid buffer id.

Parameters
[in]bufferThe buffer to be queried for its id
[out]bufferIdThe returned ID of the buffer

Return values

Relevant return values:

History

rtBufferGetId was introduced in OptiX 3.5.

See also rtContextGetBufferFromId

RTresult RTAPI rtBufferGetMipLevelCount ( RTbuffer  buffer,
unsigned int *  level 
)

Gets the number of mipmap levels of this buffer object.

Description

rtBufferGetMipLevelCount returns the number of mipmap levels. Default number of MIP levels is 1.

Parameters
[in]bufferThe buffer to be queried for its number of mipmap levels
[out]levelThe return number of mipmap levels

Return values

Relevant return values:

History

rtBufferGetMipLevelCount was introduced in OptiX 3.9.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferGetMipLevelSize1D ( RTbuffer  buffer,
unsigned int  level,
RTsize *  width 
)

Gets the width of buffer specific MIP level.

Description

rtBufferGetMipLevelSize1D stores the width of buffer in *width.

Parameters
[in]bufferThe buffer to be queried for its dimensions
[in]levelThe buffer MIP level index to be queried for its dimensions
[out]widthThe return handle for the buffer's width Return values

Relevant return values:

History

rtBufferGetMipLevelSize1D was introduced in OptiX 3.9.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferGetMipLevelSize2D ( RTbuffer  buffer,
unsigned int  level,
RTsize *  width,
RTsize *  height 
)

Gets the width, height of buffer specific MIP level.

Description

rtBufferGetMipLevelSize2D stores the width, height of buffer in *width and *height respectively.

Parameters
[in]bufferThe buffer to be queried for its dimensions
[in]levelThe buffer MIP level index to be queried for its dimensions
[out]widthThe return handle for the buffer's width
[out]heightThe return handle for the buffer's height Return values

Relevant return values:

History

rtBufferGetMipLevelSize2D was introduced in OptiX 3.9.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferGetMipLevelSize3D ( RTbuffer  buffer,
unsigned int  level,
RTsize *  width,
RTsize *  height,
RTsize *  depth 
)

Gets the width, height and depth of buffer specific MIP level.

Description

rtBufferGetMipLevelSize3D stores the width, height and depth of buffer in *width, *height and *depth, respectively.

Parameters
[in]bufferThe buffer to be queried for its dimensions
[in]levelThe buffer MIP level index to be queried for its dimensions
[out]widthThe return handle for the buffer's width
[out]heightThe return handle for the buffer's height
[out]depthThe return handle for the buffer's depth Return values

Relevant return values:

History

rtBufferGetMipLevelSize3D was introduced in OptiX 3.9.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferGetProgressiveUpdateReady ( RTbuffer  buffer,
int *  ready,
unsigned int *  subframeCount,
unsigned int *  maxSubframes 
)

Check whether stream buffer content has been updated by a Progressive Launch.

Description

Returns whether or not the result of a progressive launch in buffer has been updated since the last time this function was called. A client application should use this call in its main render/display loop to poll for frame refreshes after initiating a progressive launch. If subframeCount and maxSubframes are non-null, they will be filled with the corresponding counters if and only if ready returns 1.

Note that this call does not stop a progressive render.

Parameters
[in]bufferThe stream buffer to be queried
[out]readyReady flag. Will be set to 1 if an update is available, or 0 if no update is available.
[out]subframeCountThe number of subframes accumulated in the latest result
[out]maxSubframesThe maxSubframes parameter as specified in the call to rtContextLaunchProgressive2D

Return values

Relevant return values:

History

rtBufferGetProgressiveUpdateReady was introduced in OptiX 3.8.

See also rtContextLaunchProgressive2D

RTresult RTAPI rtBufferGetSize1D ( RTbuffer  buffer,
RTsize *  width 
)

Get the width of this buffer.

Description

rtBufferGetSize1D stores the width of buffer in *width.

Parameters
[in]bufferThe buffer to be queried for its dimensions
[out]widthThe return handle for the buffer's width

Return values

Relevant return values:

History

rtBufferGetSize1D was introduced in OptiX 1.0.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferGetSize2D ( RTbuffer  buffer,
RTsize *  width,
RTsize *  height 
)

Gets the width and height of this buffer.

Description

rtBufferGetSize2D stores the width and height of buffer in *width and *height, respectively.

Parameters
[in]bufferThe buffer to be queried for its dimensions
[out]widthThe return handle for the buffer's width
[out]heightThe return handle for the buffer's height

Return values

Relevant return values:

History

rtBufferGetSize2D was introduced in OptiX 1.0.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferGetSize3D ( RTbuffer  buffer,
RTsize *  width,
RTsize *  height,
RTsize *  depth 
)

Gets the width, height and depth of this buffer.

Description

rtBufferGetSize3D stores the width, height and depth of buffer in *width, *height and *depth, respectively.

Parameters
[in]bufferThe buffer to be queried for its dimensions
[out]widthThe return handle for the buffer's width
[out]heightThe return handle for the buffer's height
[out]depthThe return handle for the buffer's depth

Return values

Relevant return values:

History

rtBufferGetSize3D was introduced in OptiX 1.0.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSizev

RTresult RTAPI rtBufferGetSizev ( RTbuffer  buffer,
unsigned int  dimensionality,
RTsize *  dims 
)

Gets the dimensions of this buffer.

Description

rtBufferGetSizev stores the dimensions of buffer in *dims. The number of dimensions returned is specified by dimensionality. The storage at dims must be large enough to hold the number of requested buffer dimensions.

Parameters
[in]bufferThe buffer to be queried for its dimensions
[in]dimensionalityThe number of requested dimensions
[out]dimsThe array of dimensions to store to

Return values

Relevant return values:

History

rtBufferGetSizev was introduced in OptiX 1.0.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D

RTresult RTAPI rtBufferMap ( RTbuffer  buffer,
void **  userPointer 
)

Maps a buffer object to the host.

Description

rtBufferMap returns a pointer, accessible by the host, in *userPointer that contains a mapped copy of the contents of buffer. The memory pointed to by *userPointer can be written to or read from, depending on the type of buffer. For example, this code snippet demonstrates creating and filling an input buffer with floats.

RTbuffer buffer;
float* data;
rtBufferCreate(context, RT_BUFFER_INPUT, &buffer);
rtBufferSetSize1D(buffer, 10);
rtBufferMap(buffer, (void*)&data);
for(int i = 0; i < 10; ++i)
data[i] = 4.f * i;
rtBufferUnmap(buffer);

If buffer has already been mapped, returns RT_ERROR_ALREADY_MAPPED. If buffer has size zero, the returned pointer is undefined.

Note that this call does not stop a progressive render if called on a stream buffer.

Parameters
[in]bufferThe buffer to be mapped
[out]userPointerReturn handle to a user pointer where the buffer will be mapped to

Return values

Relevant return values:

History

rtBufferMap was introduced in OptiX 1.0.

See also rtBufferUnmap, rtBufferMapEx, rtBufferUnmapEx

RTresult RTAPI rtBufferMapEx ( RTbuffer  buffer,
unsigned int  mapFlags,
unsigned int  level,
void *  userOwned,
void **  optixOwned 
)

Maps mipmap level of buffer object to the host.

Description

rtBufferMapEx makes the buffer contents available on the host, either by returning a pointer in *optixOwned, or by copying the contents to a memory location pointed to by userOwned. Calling rtBufferMapEx with proper map flags can result in better performance than using rtBufferMap, because fewer synchronization copies are required in certain situations. rtBufferMapEx with mapFlags = RT_BUFFER_MAP_READ_WRITE and level = 0 is equivalent to rtBufferMap.

Note that this call does not stop a progressive render if called on a stream buffer.

Parameters
[in]bufferThe buffer to be mapped
[in]mapFlagsMap flags, see below
[in]levelThe mipmap level to be mapped
[in]userOwnedNot yet supported. Must be NULL
[out]optixOwnedReturn handle to a user pointer where the buffer will be mapped to

The following flags are supported for mapFlags. They are mutually exclusive:

Return values

Relevant return values:

History

rtBufferMapEx was introduced in OptiX 3.9.

See also rtBufferMap, rtBufferUnmap, rtBufferUnmapEx

RTresult RTAPI rtBufferSetAttribute ( RTbuffer  buffer,
RTbufferattribute  attrib,
RTsize  size,
const void *  p 
)

Set a buffer attribute.

Description

Sets a buffer attribute. Currently, all available attributes refer to stream buffers only, and attempting to set them on a non-stream buffer will generate an error.

Each attribute can have a different size. The sizes are given in the following list:

RT_BUFFER_ATTRIBUTE_STREAM_FORMAT sets the encoding format used for streams sent over the network, specified as a string. The default is "auto". Various other common stream and image formats are available (e.g. "h264", "png"). This attribute has no effect if the progressive API is used locally.

RT_BUFFER_ATTRIBUTE_STREAM_BITRATE sets the target bitrate for streams sent over the network, if the stream format supports it. The data is specified as a 32-bit integer. The default is 5000000. This attribute has no effect if the progressive API is used locally or if the stream format does not support variable bitrates.

RT_BUFFER_ATTRIBUTE_STREAM_FPS sets the target update rate per second for streams sent over the network, if the stream format supports it. The data is specified as a 32-bit integer. The default is 30. This attribute has no effect if the progressive API is used locally or if the stream format does not support variable framerates.

RT_BUFFER_ATTRIBUTE_STREAM_GAMMA sets the gamma value for the built-in tonemapping operator. The data is specified as a 32-bit float, the default is 1.0. Tonemapping is executed before encoding the accumulated output into the stream, i.e. on the server side if remote rendering is used. See the section on Buffers below for more details.

Parameters
[in]bufferThe buffer on which to set the attribute
[in]attribThe attribute to set
[in]sizeThe size of the attribute value, in bytes
[in]pPointer to the attribute value

Return values

Relevant return values:

History

rtBufferSetAttribute was introduced in OptiX 3.8.

See also rtBufferGetAttribute

RTresult RTAPI rtBufferSetElementSize ( RTbuffer  buffer,
RTsize  elementSize 
)

Modifies the size in bytes of a buffer's individual elements.

Description

rtBufferSetElementSize modifies the size in bytes of a buffer's user-formatted elements. The target buffer is specified by buffer, which should be a value returned by rtBufferCreate and should have format RT_FORMAT_USER. The new size of the buffer's individual elements is specified by elementSize and should not be 0. If the buffer has format RT_FORMAT_USER, and elementSize is not 0, then the buffer's individual element size is set to elemenSize and all storage associated with the buffer is reset. Otherwise, this call has no effect and returns either RT_ERROR_TYPE_MISMATCH if the buffer does not have format RT_FORMAT_USER or RT_ERROR_INVALID_VALUE if the buffer has format RT_FORMAT_USER but elemenSize is 0.

Parameters
[in]bufferSpecifies the buffer to be modified
[in]elementSizeSpecifies the new size in bytes of the buffer's individual elements

Return values

Relevant return values:

History

rtBufferSetElementSize was introduced in OptiX 1.0.

See also rtBufferGetElementSize, rtBufferCreate

RTresult RTAPI rtBufferSetFormat ( RTbuffer  buffer,
RTformat  format 
)

Sets the format of this buffer.

Description

rtBufferSetFormat changes the format of buffer to the specified value. The data elements of the buffer will have the specified type and can either be vector formats, or a user-defined type whose size is specified with rtBufferSetElementSize. Possible values for format are:

Buffers of block-compressed formats like RT_FORMAT_BC6H must be sized to a quarter of the uncompressed view resolution in each dimension, i.e.

rtBufferSetSize2D( buffer, width/4, height/4 );

The base type of the internal buffer will then correspond to RT_FORMAT_UNSIGNED_INT2 for BC1 and BC4 formats and RT_FORMAT_UNSIGNED_INT4 for all other BC formats.

Parameters
[in]bufferThe buffer to have its format set
[in]formatThe target format of the buffer

Return values

Relevant return values:

History

rtBufferSetFormat was introduced in OptiX 1.0.

See also rtBufferSetFormat, rtBufferGetFormat, rtBufferGetFormat, rtBufferGetElementSize, rtBufferSetElementSize

RTresult RTAPI rtBufferSetMipLevelCount ( RTbuffer  buffer,
unsigned int  levels 
)

Sets the MIP level count of a buffer.

Description

rtBufferSetMipLevelCount sets the number of MIP levels to levels. The default number of MIP levels is 1. Fails with RT_ERROR_ALREADY_MAPPED if called on a buffer that is mapped.

Parameters
[in]bufferThe buffer to be resized
[in]levelsNumber of mip levels

Return values

Relevant return values:

History

rtBufferSetMipLevelCount was introduced in OptiX 3.9.

See also rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferSetSize1D ( RTbuffer  buffer,
RTsize  width 
)

Sets the width and dimensionality of this buffer.

Description

rtBufferSetSize1D sets the dimensionality of buffer to 1 and sets its width to width. Fails with RT_ERROR_ALREADY_MAPPED if called on a buffer that is mapped.

Parameters
[in]bufferThe buffer to be resized
[in]widthThe width of the resized buffer

Return values

Relevant return values:

History

rtBufferSetSize1D was introduced in OptiX 1.0.

See also rtBufferSetMipLevelCount, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferSetSize2D ( RTbuffer  buffer,
RTsize  width,
RTsize  height 
)

Sets the width, height and dimensionality of this buffer.

Description

rtBufferSetSize2D sets the dimensionality of buffer to 2 and sets its width and height to width and height, respectively. If width or height is zero, they both must be zero. Fails with RT_ERROR_ALREADY_MAPPED if called on a buffer that is mapped.

Parameters
[in]bufferThe buffer to be resized
[in]widthThe width of the resized buffer
[in]heightThe height of the resized buffer

Return values

Relevant return values:

History

rtBufferSetSize2D was introduced in OptiX 1.0.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize3D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferSetSize3D ( RTbuffer  buffer,
RTsize  width,
RTsize  height,
RTsize  depth 
)

Sets the width, height, depth and dimensionality of a buffer.

Description

rtBufferSetSize3D sets the dimensionality of buffer to 3 and sets its width, height and depth to width, height and depth, respectively. If width, height or depth is zero, they all must be zero.

A 1D layered mipmapped buffer is allocated if height is 1 and the RT_BUFFER_LAYERED flag was set at buffer creating. The number of layers is determined by the depth. A 2D layered mipmapped buffer is allocated if the RT_BUFFER_LAYERED flag was set at buffer creating. The number of layers is determined by the depth. A cubemap mipmapped buffer is allocated if the RT_BUFFER_CUBEMAP flag was set at buffer creating. width must be equal to height and the number of cube faces is determined by the depth, it must be six or a multiple of six, if the RT_BUFFER_LAYERED flag was also set. Layered, mipmapped and cubemap buffers are supported only as texture buffers.

Fails with RT_ERROR_ALREADY_MAPPED if called on a buffer that is mapped.

Parameters
[in]bufferThe buffer to be resized
[in]widthThe width of the resized buffer
[in]heightThe height of the resized buffer
[in]depthThe depth of the resized buffer

Return values

Relevant return values:

History

rtBufferSetSize3D was introduced in OptiX 1.0.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSizev, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferSetSizev ( RTbuffer  buffer,
unsigned int  dimensionality,
const RTsize *  dims 
)

Sets the dimensionality and dimensions of a buffer.

Description

rtBufferSetSizev sets the dimensionality of buffer to dimensionality and sets the dimensions of the buffer to the values stored at *dims, which must contain a number of values equal to dimensionality. If any of values of dims is zero they must all be zero.

Parameters
[in]bufferThe buffer to be resized
[in]dimensionalityThe dimensionality the buffer will be resized to
[in]dimsThe array of sizes for the dimension of the resize

Return values

Relevant return values:

History

rtBufferSetSizev was introduced in OptiX 1.0.

See also rtBufferSetMipLevelCount, rtBufferSetSize1D, rtBufferSetSize2D, rtBufferSetSize3D, rtBufferGetMipLevelSize1D, rtBufferGetMipLevelSize2D, rtBufferGetMipLevelSize3D, rtBufferGetMipLevelCount, rtBufferGetSize1D, rtBufferGetSize2D, rtBufferGetSize3D, rtBufferGetSizev

RTresult RTAPI rtBufferUnmap ( RTbuffer  buffer)

Unmaps a buffer's storage from the host.

Description

rtBufferUnmap unmaps a buffer from the host after a call to rtBufferMap. rtContextLaunch cannot be called while buffers are still mapped to the host. A call to rtBufferUnmap that does not follow a matching rtBufferMap call will return RT_ERROR_INVALID_VALUE.

Note that this call does not stop a progressive render if called with a stream buffer.

Parameters
[in]bufferThe buffer to unmap

Return values

Relevant return values:

History

rtBufferUnmap was introduced in OptiX 1.0.

See also rtBufferMap, rtBufferMapEx, rtBufferUnmapEx

RTresult RTAPI rtBufferUnmapEx ( RTbuffer  buffer,
unsigned int  level 
)

Unmaps mipmap level storage from the host.

Description

rtBufferUnmapEx unmaps buffer level from the host after a call to rtBufferMapEx. rtContextLaunch cannot be called while buffers are still mapped to the host. A call to rtBufferUnmapEx that does not follow a matching rtBufferMapEx call will return RT_ERROR_INVALID_VALUE. rtBufferUnmap is equivalent to rtBufferUnmapEx with level = 0.

Note that this call does not stop a progressive render if called with a stream buffer.

Parameters
[in]bufferThe buffer to unmap
[in]levelThe mipmap level to unmap

Return values

Relevant return values:

History

rtBufferUnmapEx was introduced in OptiX 3.9.

See also rtBufferMap, rtBufferUnmap, rtBufferMapEx

RTresult RTAPI rtBufferValidate ( RTbuffer  buffer)

Validates the state of a buffer.

Description

rtBufferValidate checks buffer for completeness. If buffer has not had its dimensionality, size or format set, this call will return RT_ERROR_INVALID_CONTEXT.

Parameters
[in]bufferThe buffer to validate

Return values

Relevant return values:

History

rtBufferValidate was introduced in OptiX 1.0.

See also rtBufferCreate, rtBufferCreateFromGLBO rtContextValidate

RTresult RTAPI rtCommandListAppendLaunch2D ( RTcommandlist  list,
unsigned int  entryPointIndex,
RTsize  launchWidth,
RTsize  launchHeight 
)

Append a launch to the command list list.

Description

rtCommandListAppendLaunch2D appends a context launch to the command list list. It is invalid to call rtCommandListAppendLaunch2D after calling rtCommandListFinalize.

Parameters
[in]listHandle of the command list to append to
[in]entryPointIndexThe initial entry point into the kernel
[in]launchWidthWidth of the computation grid
[in]launchHeightHeight of the computation grid

Return values

Relevant return values:

History

rtCommandListAppendLaunch2D was introduced in OptiX 5.0.

See also rtCommandListCreate, rtCommandListDestroy, rtCommandListAppendPostprocessingStage, rtCommandListFinalize, rtCommandListExecute

RTresult RTAPI rtCommandListAppendPostprocessingStage ( RTcommandlist  list,
RTpostprocessingstage  stage,
RTsize  launchWidth,
RTsize  launchHeight 
)

Append a post-processing stage to the command list list.

Description

rtCommandListAppendPostprocessingStage appends a post-processing stage to the command list list. The command list must have been created from the same context as the the post-processing stage. The launchWidth and launchHeight specify the launch dimensions and may be different than the input or output buffers associated with each post-processing stage depending on the requirements of the post-processing stage appended. It is invalid to call rtCommandListAppendPostprocessingStage after calling rtCommandListFinalize.

NOTE: A post-processing stage can be added to multiple command lists or added to the same command list multiple times. Also note that destroying a post-processing stage will invalidate all command lists it was added to.

Parameters
[in]listHandle of the command list to append to
[in]stageThe post-processing stage to append to the command list
[in]launchWidthThis is a hint for the width of the launch dimensions to use for this stage. The stage can ignore this and use a suitable launch width instead.
[in]launchWidthThis is a hint for the height of the launch dimensions to use for this stage. The stage can ignore this and use a suitable launch height instead.

Return values

Relevant return values:

History

rtCommandListAppendPostprocessingStage was introduced in OptiX 5.0.

See also rtCommandListCreate, rtCommandListDestroy, rtCommandListAppendLaunch2D, rtCommandListFinalize, rtCommandListExecute rtPostProcessingStageCreateBuiltin,

RTresult RTAPI rtCommandListCreate ( RTcontext  context,
RTcommandlist list 
)

Creates a new command list.

Description

rtCommandListCreate creates a new command list. The context specifies the target context, and should be a value returned by rtContextCreate. The call sets *list to the handle of a newly created list within context. Returns RT_ERROR_INVALID_VALUE if list is NULL.

A command list can be used to assemble a list of different types of commands and execute them later. At this point, commands can be built-in post-processing stages or context launches. Those are appended to the list using rtCommandListAppendPostprocessingStage, and rtCommandListAppendLaunch2D, respectively. Commands will be executed in the order they have been appended to the list. Thus later commands can use the results of earlier commands. Note that all commands added to the created list must be associated with the same context. It is invalid to mix commands from different contexts.

Parameters
[in]contextSpecifies the rendering context of the command list
[out]listNew command list handle

Return values

Relevant return values:

History

rtCommandListCreate was introduced in OptiX 5.0.

See also rtCommandListDestroy, rtCommandListAppendPostprocessingStage, rtCommandListAppendLaunch2D, rtCommandListFinalize, rtCommandListExecute

RTresult RTAPI rtCommandListDestroy ( RTcommandlist  list)

Destroy a command list.

Description

rtCommandListDestroy destroys a command list from its context and deletes it. After the call, list is no longer a valid handle. Any stages associated with the command list are not destroyed.

Parameters
[in]listHandle of the command list to destroy

Return values

Relevant return values:

History

rtCommandListDestroy was introduced in OptiX 5.0.

See also rtCommandListCreate, rtCommandListAppendPostprocessingStage, rtCommandListAppendLaunch2D, rtCommandListFinalize, rtCommandListExecute

RTresult RTAPI rtCommandListExecute ( RTcommandlist  list)

Execute the command list.

Description

rtCommandListExecute executes the command list. All added commands will be executed in the order in which they were added. Commands can access the results of earlier executed commands. This must be called after calling rtCommandListFinalize, otherwise an error will be returned and the command list is not executed. rtCommandListExecute can be called multiple times, but only one call may be active at the same time. Overlapping calls from multiple threads will result in undefined behavior.

Parameters
[in]listHandle of the command list to execute

Return values

Relevant return values:

History

rtCommandListExecute was introduced in OptiX 5.0.

See also rtCommandListCreate, rtCommandListDestroy, rtCommandListAppendPostprocessingStage, rtCommandListAppendLaunch2D, rtCommandListFinalize,

RTresult RTAPI rtCommandListFinalize ( RTcommandlist  list)

Finalize the command list. This must be done before executing the command list.

Description

rtCommandListFinalize finalizes the command list. This will do all work necessary to prepare the command list for execution. Specifically it will do all work which can be shared between subsequent calls to rtCommandListExecute. It is invalid to call rtCommandListExecute before calling rtCommandListFinalize. It is invalid to call rtCommandListAppendPostprocessingStage or rtCommandListAppendLaunch2D after calling finalize and will result in an error. Also rtCommandListFinalize can only be called once on each command list.

Parameters
[in]listHandle of the command list to finalize

Return values

Relevant return values:

History

rtCommandListFinalize was introduced in OptiX 5.0.

See also rtCommandListCreate, rtCommandListDestroy, rtCommandListAppendPostprocessingStage, rtCommandListAppendLaunch2D, rtCommandListExecute

RTresult RTAPI rtCommandListGetContext ( RTcommandlist  list,
RTcontext context 
)

Returns the context associated with a command list.

Description

rtCommandListGetContext queries the context associated with a command list. The target command list is specified by list. The context of the command list is returned to *context if the pointer context is not NULL. If list is not a valid command list, *context is set to NULL and RT_ERROR_INVALID_VALUE is returned.

Parameters
[in]listSpecifies the command list to be queried
[out]contextReturns the context associated with the command list

Return values

Relevant return values:

History

rtCommandListGetContext was introduced in OptiX 5.0.

See also rtContextDeclareVariable

RTresult RTAPI rtContextCompile ( RTcontext  context)

Deprecated in OptiX 4.0. Calling this function has no effect. The kernel is automatically compiled at launch if needed.

RTresult RTAPI rtContextCreate ( RTcontext context)

Creates a new context object.

Description

rtContextCreate allocates and returns a handle to a new context object. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[out]contextHandle to context for return value

Return values

Relevant return values:

History

rtContextCreate was introduced in OptiX 1.0.

See also

RTresult RTAPI rtContextDeclareVariable ( RTcontext  context,
const char *  name,
RTvariable v 
)

Declares a new named variable associated with this context.

Description

rtContextDeclareVariable - Declares a new variable named name and associated with this context. Only a single variable of a given name can exist for a given context and any attempt to create multiple variables with the same name will cause a failure with a return value of RT_ERROR_VARIABLE_REDECLARED. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer. Return RT_ERROR_ILLEGAL_SYMBOL if name is not syntactically valid.

Parameters
[in]contextThe context node to which the variable will be attached
[in]nameThe name that identifies the variable to be queried
[out]vPointer to variable handle used to return the new object

Return values

Relevant return values:

History

rtContextDeclareVariable was introduced in OptiX 1.0.

See also rtGeometryDeclareVariable, rtGeometryInstanceDeclareVariable, rtMaterialDeclareVariable, rtProgramDeclareVariable, rtSelectorDeclareVariable, rtContextGetVariable, rtContextGetVariableCount, rtContextQueryVariable, rtContextRemoveVariable

RTresult RTAPI rtContextDestroy ( RTcontext  context)

Destroys a context and frees all associated resources.

Description

rtContextDestroy frees all resources, including OptiX objects, associated with this object. Returns RT_ERROR_INVALID_VALUE if passed a NULL context. RT_ERROR_LAUNCH_FAILED may be returned if a previous call to rtContextLaunch failed.

Parameters
[in]contextHandle of the context to destroy

Return values

Relevant return values:

History

rtContextDestroy was introduced in OptiX 1.0.

See also rtContextCreate

RTresult RTAPI rtContextGetAttribute ( RTcontext  context,
RTcontextattribute  attrib,
RTsize  size,
void *  p 
)

Returns an attribute specific to an OptiX context.

Description

rtContextGetAttribute returns in p the value of the per context attribute specified by attrib.

Each attribute can have a different size. The sizes are given in the following list:

RT_CONTEXT_ATTRIBUTE_MAX_TEXTURE_COUNT queries the maximum number of textures handled by OptiX. For OptiX versions below 2.5 this value depends on the number of textures supported by CUDA.

RT_CONTEXT_ATTRIBUTE_CPU_NUM_THREADS queries the number of host CPU threads OptiX can use for various tasks.

RT_CONTEXT_ATTRIBUTE_USED_HOST_MEMORY queries the amount of host memory allocated by OptiX.

RT_CONTEXT_ATTRIBUTE_AVAILABLE_DEVICE_MEMORY queries the amount of free device memory.

RT_CONTEXT_ATTRIBUTE_DISK_CACHE_ENABLED queries whether or not the OptiX disk cache is enabled.

RT_CONTEXT_ATTRIBUTE_DISK_CACHE_LOCATION queries the file path of the OptiX disk cache.

RT_CONTEXT_ATTRIBUTE_DISK_CACHE_MEMORY_LIMITS queries the low and high watermark values for the OptiX disk cache.

Some attributes are used to get per device information. In contrast to rtDeviceGetAttribute, these attributes are determined by the context and are therefore queried through the context. This is done by adding the attribute with the OptiX device ordinal number when querying the attribute. The following are per device attributes.

RT_CONTEXT_ATTRIBUTE_AVAILABLE_DEVICE_MEMORY

Parameters
[in]contextThe context object to be queried
[in]attribAttribute to query
[in]sizeSize of the attribute being queried. Parameter p must have at least this much memory allocated
[out]pReturn pointer where the value of the attribute will be copied into. This must point to at least size bytes of memory

Return values

Relevant return values:

  • RT_SUCCESS
  • RT_ERROR_INVALID_VALUE - Can be returned if size does not match the proper size of the attribute, if p is NULL, or if attribute+ordinal does not correspond to an OptiX device

History

rtContextGetAttribute was introduced in OptiX 2.0.

See also rtContextGetDeviceCount, rtContextSetAttribute, rtDeviceGetAttribute

RTresult RTAPI rtContextGetBufferFromId ( RTcontext  context,
int  bufferId,
RTbuffer buffer 
)

Gets an RTbuffer corresponding to the buffer id.

Description

rtContextGetBufferFromId returns a handle to the buffer in *buffer corresponding to the bufferId supplied. If bufferId does not map to a valid buffer handle, *buffer is NULL or if context is invalid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]contextThe context the buffer should be originated from
[in]bufferIdThe ID of the buffer to query
[out]bufferThe return handle for the buffer object corresponding to the bufferId

Return values

Relevant return values:

History

rtContextGetBufferFromId was introduced in OptiX 3.5.

See also rtBufferGetId

RTresult RTAPI rtContextGetDeviceCount ( RTcontext  context,
unsigned int *  count 
)

Query the number of devices currently being used.

Description

rtContextGetDeviceCount - Query the number of devices currently being used.

Parameters
[in]contextThe context containing the devices
[out]countReturn parameter for the device count

Return values

Relevant return values:

History

rtContextGetDeviceCount was introduced in OptiX 2.0.

See also rtContextSetDevices, rtContextGetDevices

RTresult RTAPI rtContextGetDevices ( RTcontext  context,
int *  devices 
)

Retrieve a list of hardware devices being used by the kernel.

Description

rtContextGetDevices retrieves a list of hardware devices used by the context. Note that the device numbers are OptiX device ordinals, which may not be the same as CUDA device ordinals. Use rtDeviceGetAttribute with RT_DEVICE_ATTRIBUTE_CUDA_DEVICE_ORDINAL to query the CUDA device corresponding to a particular OptiX device.

Parameters
[in]contextThe context to which the hardware list is applied
[out]devicesReturn parameter for the list of devices. The memory must be able to hold entries numbering least the number of devices as returned by rtContextGetDeviceCount

Return values

Relevant return values:

History

rtContextGetDevices was introduced in OptiX 2.0.

See also rtContextSetDevices, rtContextGetDeviceCount

RTresult RTAPI rtContextGetEntryPointCount ( RTcontext  context,
unsigned int *  count 
)

Query the number of entry points for this context.

Description

rtContextGetEntryPointCount passes back the number of entry points associated with this context in count. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[in]contextThe context node to be queried
[out]countReturn parameter for passing back the entry point count

Return values

Relevant return values:

History

rtContextGetEntryPointCount was introduced in OptiX 1.0.

See also rtContextSetEntryPointCount

void RTAPI rtContextGetErrorString ( RTcontext  context,
RTresult  code,
const char **  stringReturn 
)

Returns the error string associated with a given error.

Description

rtContextGetErrorString return a descriptive string given an error code. If context is valid and additional information is available from the last OptiX failure, it will be appended to the generic error code description. stringReturn will be set to point to this string. The memory stringReturn points to will be valid until the next API call that returns a string.

Parameters
[in]contextThe context object to be queried, or NULL
[in]codeThe error code to be converted to string
[out]stringReturnThe return parameter for the error string

Return values

rtContextGetErrorString does not return a value

History

rtContextGetErrorString was introduced in OptiX 1.0.

See also

RTresult RTAPI rtContextGetExceptionEnabled ( RTcontext  context,
RTexception  exception,
int *  enabled 
)

Query whether a specified exception is enabled.

Description

rtContextGetExceptionEnabled passes back 1 in *enabled if the given exception is enabled, 0 otherwise. exception specifies the type of exception to be queried. For a list of available types, see rtContextSetExceptionEnabled. If exception is RT_EXCEPTION_ALL, enabled is set to 1 only if all possible exceptions are enabled.

Parameters
[in]contextThe context to be queried
[in]exceptionThe exception of which to query the state
[out]enabledReturn parameter to store whether the exception is enabled

Return values

Relevant return values:

History

rtContextGetExceptionEnabled was introduced in OptiX 1.1.

See also rtContextSetExceptionEnabled, rtContextSetExceptionProgram, rtContextGetExceptionProgram, rtGetExceptionCode, rtThrow, rtPrintExceptionDetails, RTexception

RTresult RTAPI rtContextGetExceptionProgram ( RTcontext  context,
unsigned int  entryPointIndex,
RTprogram program 
)

Queries the exception program associated with the given context and entry point.

Description

rtContextGetExceptionProgram passes back the exception program associated with the given context and entry point. This program is set via rtContextSetExceptionProgram. Returns RT_ERROR_INVALID_VALUE if given an invalid entry point index or NULL pointer.

Parameters
[in]contextThe context node associated with the exception program
[in]entryPointIndexThe entry point index for the desired exception program
[out]programReturn parameter to store the exception program

Return values

Relevant return values:

History

rtContextGetExceptionProgram was introduced in OptiX 1.0.

See also rtContextSetExceptionProgram, rtContextSetEntryPointCount, rtContextSetExceptionEnabled, rtContextGetExceptionEnabled, rtGetExceptionCode, rtThrow, rtPrintExceptionDetails

RTresult RTAPI rtContextGetMaxCallableProgramDepth ( RTcontext  context,
unsigned int *  maxDepth 
)

Query the maximum call depth for callable programs.

Description

rtContextGetMaxCallableProgramDepth passes back the maximum callable program call depth associated with this context in maxDepth. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[in]contextThe context node to be queried
[out]maxDepthReturn parameter to store the maximum callable program depth

Return values

Relevant return values:

History

rtContextGetMaxCallableProgramDepth was introduced in OptiX 6.0

See also rtContextSetMaxCallableProgramDepth

RTresult RTAPI rtContextGetMaxTraceDepth ( RTcontext  context,
unsigned int *  maxDepth 
)

Query the maximum trace depth for this context.

Description

rtContextGetMaxTraceDepth passes back the maximum trace depth associated with this context in maxDepth. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[in]contextThe context node to be queried
[out]maxDepthReturn parameter to store the maximum trace depth

Return values

Relevant return values:

History

rtContextGetMaxTraceDepth was introduced in OptiX 6.0.

See also rtContextSetMaxTraceDepth

RTresult RTAPI rtContextGetMissProgram ( RTcontext  context,
unsigned int  rayTypeIndex,
RTprogram program 
)

Queries the miss program associated with the given context and ray type.

Description

rtContextGetMissProgram passes back the miss program associated with the given context and ray type. This program is set via rtContextSetMissProgram. Returns RT_ERROR_INVALID_VALUE if given an invalid ray type index or a NULL pointer.

Parameters
[in]contextThe context node associated with the miss program
[in]rayTypeIndexThe ray type index for the desired miss program
[out]programReturn parameter to store the miss program

Return values

Relevant return values:

History

rtContextGetMissProgram was introduced in OptiX 1.0.

See also rtContextSetMissProgram, rtContextGetRayTypeCount

RTresult RTAPI rtContextGetPrintBufferSize ( RTcontext  context,
RTsize *  bufferSizeBytes 
)

Get the current size of the print buffer.

Description

rtContextGetPrintBufferSize is used to query the buffer size available to hold data generated by rtPrintf. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[in]contextThe context from which to query the print buffer size
[out]bufferSizeBytesThe returned print buffer size in bytes

Return values

Relevant return values:

History

rtContextGetPrintBufferSize was introduced in OptiX 1.0.

See also rtPrintf, rtContextSetPrintEnabled, rtContextGetPrintEnabled, rtContextSetPrintBufferSize, rtContextSetPrintLaunchIndex, rtContextGetPrintLaunchIndex

RTresult RTAPI rtContextGetPrintEnabled ( RTcontext  context,
int *  enabled 
)

Query whether text printing from programs is enabled.

Description

rtContextGetPrintEnabled passes back 1 if text printing from programs through rtPrintf is currently enabled for this context; 0 otherwise. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[in]contextThe context to be queried
[out]enabledReturn parameter to store whether printing is enabled

Return values

Relevant return values:

History

rtContextGetPrintEnabled was introduced in OptiX 1.0.

See also rtPrintf, rtContextSetPrintEnabled, rtContextSetPrintBufferSize, rtContextGetPrintBufferSize, rtContextSetPrintLaunchIndex, rtContextGetPrintLaunchIndex

RTresult RTAPI rtContextGetPrintLaunchIndex ( RTcontext  context,
int *  x,
int *  y,
int *  z 
)

Gets the active print launch index.

Description

rtContextGetPrintLaunchIndex is used to query for which launch indices rtPrintf generates output. The initial value of (x,y,z) is (-1,-1,-1), which generates output for all indices.

Parameters
[in]contextThe context from which to query the print launch index
[out]xReturns the launch index in the x dimension to which the output of rtPrintf invocations is limited. Will not be written to if a NULL pointer is passed
[out]yReturns the launch index in the y dimension to which the output of rtPrintf invocations is limited. Will not be written to if a NULL pointer is passed
[out]zReturns the launch index in the z dimension to which the output of rtPrintf invocations is limited. Will not be written to if a NULL pointer is passed

Return values

Relevant return values:

History

rtContextGetPrintLaunchIndex was introduced in OptiX 1.0.

See also rtPrintf, rtContextGetPrintEnabled, rtContextSetPrintEnabled, rtContextSetPrintBufferSize, rtContextGetPrintBufferSize, rtContextSetPrintLaunchIndex

RTresult RTAPI rtContextGetProgramFromId ( RTcontext  context,
int  programId,
RTprogram program 
)

Gets an RTprogram corresponding to the program id.

Description

rtContextGetProgramFromId returns a handle to the program in *program corresponding to the programId supplied. If programId is not a valid program handle, *program is set to NULL. Returns RT_ERROR_INVALID_VALUE if context is invalid or programId is not a valid program handle.

Parameters
[in]contextThe context the program should be originated from
[in]programIdThe ID of the program to query
[out]programThe return handle for the program object corresponding to the programId

Return values

Relevant return values:

History

rtContextGetProgramFromId was introduced in OptiX 3.6.

See also rtProgramGetId

RTresult RTAPI rtContextGetRayGenerationProgram ( RTcontext  context,
unsigned int  entryPointIndex,
RTprogram program 
)

Queries the ray generation program associated with the given context and entry point.

Description

rtContextGetRayGenerationProgram passes back the ray generation program associated with the given context and entry point. This program is set via rtContextSetRayGenerationProgram. Returns RT_ERROR_INVALID_VALUE if given an invalid entry point index or NULL pointer.

Parameters
[in]contextThe context node associated with the ray generation program
[in]entryPointIndexThe entry point index for the desired ray generation program
[out]programReturn parameter to store the ray generation program

Return values

Relevant return values:

History

rtContextGetRayGenerationProgram was introduced in OptiX 1.0.

See also rtContextSetRayGenerationProgram

RTresult RTAPI rtContextGetRayTypeCount ( RTcontext  context,
unsigned int *  rayTypeCount 
)

Query the number of ray types associated with this context.

Description

rtContextGetRayTypeCount passes back the number of entry points associated with this context in rayTypeCount. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[in]contextThe context node to be queried
[out]rayTypeCountReturn parameter to store the number of ray types

Return values

Relevant return values:

History

rtContextGetRayTypeCount was introduced in OptiX 1.0.

See also rtContextSetRayTypeCount

RTresult RTAPI rtContextGetRunningState ( RTcontext  context,
int *  running 
)

Query whether the given context is currently running.

Description

This function is currently unimplemented and it is provided as a placeholder for a future implementation.

Parameters
[in]contextThe context node to be queried
[out]runningReturn parameter to store the running state

Return values

Since unimplemented, this function will always throw an assertion failure.

History

rtContextGetRunningState was introduced in OptiX 1.0.

See also rtContextLaunch1D, rtContextLaunch2D, rtContextLaunch3D

RTresult RTAPI rtContextGetStackSize ( RTcontext  context,
RTsize *  bytes 
)

Query the stack size for this context.

Description

rtContextGetStackSize passes back the stack size associated with this context in bytes. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[in]contextThe context node to be queried
[out]bytesReturn parameter to store the size of the stack

Return values

Relevant return values:

History

rtContextGetStackSize was introduced in OptiX 1.0.

See also rtContextSetStackSize

RTresult RTAPI rtContextGetTextureSamplerFromId ( RTcontext  context,
int  samplerId,
RTtexturesampler sampler 
)

Gets an RTtexturesampler corresponding to the texture id.

Description

rtContextGetTextureSamplerFromId returns a handle to the texture sampler in *sampler corresponding to the samplerId supplied. If samplerId does not map to a valid texture handle, *sampler is NULL or if context is invalid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]contextThe context the sampler should be originated from
[in]samplerIdThe ID of the sampler to query
[out]samplerThe return handle for the sampler object corresponding to the samplerId

Return values

Relevant return values:

History

rtContextGetTextureSamplerFromId was introduced in OptiX 3.5.

See also rtTextureSamplerGetId

RTresult RTAPI rtContextGetVariable ( RTcontext  context,
unsigned int  index,
RTvariable v 
)

Queries an indexed variable associated with this context.

Description

rtContextGetVariable queries the variable at position index in the variable array from context and stores the result in the parameter v. A variable must be declared first with rtContextDeclareVariable and index must be in the range [0, rtContextGetVariableCount -1].

Parameters
[in]contextThe context node to be queried for an indexed variable
[in]indexThe index that identifies the variable to be queried
[out]vReturn value to store the queried variable

Return values

Relevant return values:

History

rtContextGetVariable was introduced in OptiX 1.0.

See also rtGeometryGetVariable, rtGeometryInstanceGetVariable, rtMaterialGetVariable, rtProgramGetVariable, rtSelectorGetVariable, rtContextDeclareVariable, rtContextGetVariableCount, rtContextQueryVariable, rtContextRemoveVariable

RTresult RTAPI rtContextGetVariableCount ( RTcontext  context,
unsigned int *  count 
)

Returns the number of variables associated with this context.

Description

rtContextGetVariableCount returns the number of variables that are currently attached to context. Returns RT_ERROR_INVALID_VALUE if passed a NULL pointer.

Parameters
[in]contextThe context to be queried for number of attached variables
[out]countReturn parameter to store the number of variables

Return values

Relevant return values:

History

rtContextGetVariableCount was introduced in OptiX 1.0.

See also rtGeometryGetVariableCount, rtGeometryInstanceGetVariableCount, rtMaterialGetVariableCount, rtProgramGetVariableCount, rtSelectorGetVariable, rtContextDeclareVariable, rtContextGetVariable, rtContextQueryVariable, rtContextRemoveVariable

RTresult RTAPI rtContextLaunch1D ( RTcontext  context,
unsigned int  entryPointIndex,
RTsize  width 
)

Executes the computation kernel for a given context.

Description

rtContextLaunch functions execute the computation kernel associated with the given context. If the context has not yet been compiled, or if the context has been modified since the last compile, rtContextLaunch will recompile the kernel internally. Acceleration structures of the context which are marked dirty will be updated and their dirty flags will be cleared. Similarly, validation will occur if necessary. The ray generation program specified by entryPointIndex will be invoked once for every element (pixel or voxel) of the computation grid specified by width, height, and depth.

For 3D launches, the product of width and depth must be smaller than 4294967296 (2^32).

Return values

Relevant return values:

History

rtContextLaunch was introduced in OptiX 1.0.

See also rtContextGetRunningState, rtContextValidate

Parameters
[in]contextThe context to be executed
[in]entryPointIndexThe initial entry point into kernel
[in]widthWidth of the computation grid
RTresult RTAPI rtContextLaunch2D ( RTcontext  context,
unsigned int  entryPointIndex,
RTsize  width,
RTsize  height 
)
Parameters
[in]contextThe context to be executed
[in]entryPointIndexThe initial entry point into kernel
[in]widthWidth of the computation grid
[in]heightHeight of the computation grid
RTresult RTAPI rtContextLaunch3D ( RTcontext  context,
unsigned int  entryPointIndex,
RTsize  width,
RTsize  height,
RTsize  depth 
)
Parameters
[in]contextThe context to be executed
[in]entryPointIndexThe initial entry point into kernel
[in]widthWidth of the computation grid
[in]heightHeight of the computation grid
[in]depthDepth of the computation grid
RTresult RTAPI rtContextLaunchProgressive2D ( RTcontext  context,
unsigned int  entryIndex,
RTsize  width,
RTsize  height,
unsigned int  maxSubframes 
)

Executes a Progressive Launch for a given context.

Description

Starts the (potentially parallel) generation of subframes for progressive rendering. If maxSubframes is zero, there is no limit on the number of subframes generated. The generated subframes are automatically composited into a single result and streamed to the client at regular intervals, where they can be read by mapping an associated stream buffer. An application can therefore initiate a progressive launch, and then repeatedly map and display the contents of the stream buffer in order to visualize the progressive refinement of the image.

The call is nonblocking. A polling approach should be used to decide when to map and display the stream buffer contents (see rtBufferGetProgressiveUpdateReady). If a progressive launch is already in progress at the time of the call and its parameters match the initial launch, the call has no effect. Otherwise, the accumulated result will be reset and a new progressive launch will be started.

If any other OptiX function is called while a progressive launch is in progress, it will cause the launch to stop generating new subframes (however, subframes that have already been generated and are currently in flight may still arrive at the client). The only exceptions to this rule are the operations to map a stream buffer, issuing another progressive launch with unchanged parameters, and polling for an update. Those exceptions do not cause the progressive launch to stop generating subframes.

There is no guarantee that the call actually produces any subframes, especially if rtContextLaunchProgressive2D and other OptiX commands are called in short succession. For example, during an animation, rtVariableSet calls may be tightly interleaved with progressive launches, and when rendering remotely the server may decide to skip some of the launches in order to avoid a large backlog in the command pipeline.

Parameters
[in]contextThe context in which the launch is to be executed
[in]entryIndexThe initial entry point into kernel
[in]widthWidth of the computation grid
[in]heightHeight of the computation grid
[in]maxSubframesThe maximum number of subframes to be generated. Set to zero to generate an unlimited number of subframes

Return values

Relevant return values:

History

rtContextLaunchProgressive2D was introduced in OptiX 3.8.

See also rtContextStopProgressive rtBufferGetProgressiveUpdateReady

RTresult RTAPI rtContextQueryVariable ( RTcontext  context,
const char *  name,
RTvariable v 
)

Returns a named variable associated with this context.

Description

rtContextQueryVariable queries a variable identified by the string name from context and stores the result in *v. A variable must be declared with rtContextDeclareVariable before it can be queried, otherwise *v will be set to NULL. RT_ERROR_INVALID_VALUE will be returned if name or v is NULL.

Parameters
[in]contextThe context node to query a variable from
[in]nameThe name that identifies the variable to be queried
[out]vReturn value to store the queried variable

Return values

Relevant return values:

History

rtContextQueryVariable was introduced in OptiX 1.0.

See also rtGeometryQueryVariable, rtGeometryInstanceQueryVariable, rtMaterialQueryVariable, rtProgramQueryVariable, rtSelectorQueryVariable, rtContextDeclareVariable, rtContextGetVariableCount, rtContextGetVariable, rtContextRemoveVariable

RTresult RTAPI rtContextRemoveVariable ( RTcontext  context,
RTvariable  v 
)

Removes a variable from the given context.

Description

rtContextRemoveVariable removes variable v from context if present. Returns RT_ERROR_VARIABLE_NOT_FOUND if the variable is not attached to this context. Returns RT_ERROR_INVALID_VALUE if passed an invalid variable.

Parameters
[in]contextThe context node from which to remove a variable
[in]vThe variable to be removed

Return values

Relevant return values:

History

rtContextRemoveVariable was introduced in OptiX 1.0.

See also rtGeometryRemoveVariable, rtGeometryInstanceRemoveVariable, rtMaterialRemoveVariable, rtProgramRemoveVariable, rtSelectorRemoveVariable, rtContextDeclareVariable, rtContextGetVariable, rtContextGetVariableCount, rtContextQueryVariable,

RTresult RTAPI rtContextSetAttribute ( RTcontext  context,
RTcontextattribute  attrib,
RTsize  size,
const void *  p 
)

Set an attribute specific to an OptiX context.

Description

rtContextSetAttribute sets p as the value of the per context attribute specified by attrib.

Each attribute can have a different size. The sizes are given in the following list:

RT_CONTEXT_ATTRIBUTE_CPU_NUM_THREADS sets the number of host CPU threads OptiX can use for various tasks.

RT_CONTEXT_ATTRIBUTE_PREFER_FAST_RECOMPILES is a hint about scene usage. By default OptiX produces device kernels that are optimized for the current scene. Such kernels generally run faster, but must be recompiled after some types of scene changes, causing delays. Setting PREFER_FAST_RECOMPILES to 1 will leave out some scene-specific optimizations, producing kernels that generally run slower but are less sensitive to changes in the scene.

RT_CONTEXT_ATTRIBUTE_FORCE_INLINE_USER_FUNCTIONS sets whether or not OptiX will automatically inline user functions, which is the default behavior. Please see the Programming Guide for more information about the benefits and limitations of disabling automatic inlining.

RT_CONTEXT_ATTRIBUTE_DISK_CACHE_LOCATION sets the location where the OptiX disk cache will be created. The location must be provided as a NULL-terminated string. OptiX will attempt to create the directory if it does not exist. An exception will be thrown if OptiX is unable to create the cache database file at the specified location for any reason (e.g., the path is invalid or the directory is not writable). The location of the disk cache can be overridden with the environment variable OPTIX_CAHCE_PATH. This environment variable takes precedence over the RTcontext attribute.

RT_CONTEXT_ATTRIBUTE_DISK_CACHE_MEMORY_LIMITS sets the low and high watermarks for disk cache garbage collection. The limits must be passed in as a two-element array of RTsize values, with the low limit as the first element. OptiX will throw an exception if either limit is non-zero and the high limit is not greater than the low limit. Setting either limit to zero will disable garbage collection. Garbage collection is triggered whenever the cache data size exceeds the high watermark and proceeds until the size reaches the low watermark.

Parameters
[in]contextThe context object to be modified
[in]attribAttribute to set
[in]sizeSize of the attribute being set
[in]pPointer to where the value of the attribute will be copied from. This must point to at least size bytes of memory

Return values

Relevant return values:

History

rtContextSetAttribute was introduced in OptiX 2.5.

See also rtContextGetAttribute

RTresult RTAPI rtContextSetDevices ( RTcontext  context,
unsigned int  count,
const int *  devices 
)

Specify a list of hardware devices to be used by the kernel.

Description

rtContextSetDevices specifies a list of hardware devices to be used during execution of the subsequent trace kernels. Note that the device numbers are OptiX device ordinals, which may not be the same as CUDA device ordinals. Use rtDeviceGetAttribute with RT_DEVICE_ATTRIBUTE_CUDA_DEVICE_ORDINAL to query the CUDA device corresponding to a particular OptiX device.

Parameters
[in]contextThe context to which the hardware list is applied
[in]countThe number of devices in the list
[in]devicesThe list of devices

Return values

Relevant return values:

History

rtContextSetDevices was introduced in OptiX 1.0.

See also rtContextGetDevices, rtContextGetDeviceCount

RTresult RTAPI rtContextSetEntryPointCount ( RTcontext  context,
unsigned int  count 
)

Set the number of entry points for a given context.

Description

rtContextSetEntryPointCount sets the number of entry points associated with the given context to count.

Parameters
[in]contextThe context to be modified
[in]countThe number of entry points to use

Return values

Relevant return values:

History

rtContextSetEntryPointCount was introduced in OptiX 1.0.

See also rtContextGetEntryPointCount

RTresult RTAPI rtContextSetExceptionEnabled ( RTcontext  context,
RTexception  exception,
int  enabled 
)

Enable or disable an exception.

Description

rtContextSetExceptionEnabled is used to enable or disable specific exceptions. If an exception is enabled, the exception condition is checked for at runtime, and the exception program is invoked if the condition is met. The exception program can query the type of the caught exception by calling rtGetExceptionCode. exception may take one of the following values:

RT_EXCEPTION_PAYLOAD_ACCESS_OUT_OF_BOUNDS verifies that accesses to the ray payload are within valid bounds. This exception is only supported with the RTX execution strategy.

RT_EXCEPTION_USER_EXCEPTION_CODE_OUT_OF_BOUNDS verifies that the exception code passed to rtThrow is within the valid range from RT_EXCEPTION_USER to RT_EXCEPTION_USER_MAX.

RT_EXCEPTION_TRACE_DEPTH_EXCEEDED verifies that the depth of the rtTrace tree does not exceed the limit of 31. This exception is only supported with the RTX execution strategy.

RT_EXCEPTION_TEXTURE_ID_INVALID verifies that every access of a texture id is valid, including use of RT_TEXTURE_ID_NULL and IDs out of bounds.

RT_EXCEPTION_BUFFER_ID_INVALID verifies that every access of a buffer id is valid, including use of RT_BUFFER_ID_NULL and IDs out of bounds.

RT_EXCEPTION_INDEX_OUT_OF_BOUNDS checks that rtIntersectChild and rtReportIntersection are called with a valid index.

RT_EXCEPTION_STACK_OVERFLOW checks the runtime stack against overflow. The most common cause for an overflow is a too deep rtTrace recursion tree.

RT_EXCEPTION_BUFFER_INDEX_OUT_OF_BOUNDS checks every read and write access to rtBuffer objects to be within valid bounds. This exception is supported with the RTX execution strategy only.

RT_EXCEPTION_INVALID_RAY checks the each ray's origin and direction values against NaNs and infinity values.

RT_EXCEPTION_INTERNAL_ERROR indicates an unexpected internal error in the runtime.

RT_EXCEPTION_USER is used to enable or disable all user-defined exceptions. See rtThrow for more information.

RT_EXCEPTION_ALL is a placeholder value which can be used to enable or disable all possible exceptions with a single call to rtContextSetExceptionEnabled.

By default, RT_EXCEPTION_STACK_OVERFLOW is enabled and all other exceptions are disabled.

Parameters
[in]contextThe context for which the exception is to be enabled or disabled
[in]exceptionThe exception which is to be enabled or disabled
[in]enabledNonzero to enable the exception, 0 to disable the exception

Return values

Relevant return values:

History

rtContextSetExceptionEnabled was introduced in OptiX 1.1.

See also rtContextGetExceptionEnabled, rtContextSetExceptionProgram, rtContextGetExceptionProgram, rtGetExceptionCode, rtThrow, rtPrintExceptionDetails, RTexception

RTresult RTAPI rtContextSetExceptionProgram ( RTcontext  context,
unsigned int  entryPointIndex,
RTprogram  program 
)

Specifies the exception program for a given context entry point.

Description

rtContextSetExceptionProgram sets context's exception program at entry point entryPointIndex. RT_ERROR_INVALID_VALUE is returned if entryPointIndex is outside of the range [0, rtContextGetEntryPointCount -1].

Parameters
[in]contextThe context node to which the exception program will be added
[in]entryPointIndexThe entry point the program will be associated with
[in]programThe exception program

Return values

Relevant return values:

History

rtContextSetExceptionProgram was introduced in OptiX 1.0.

See also rtContextGetEntryPointCount, rtContextGetExceptionProgram rtContextSetExceptionEnabled, rtContextGetExceptionEnabled, rtGetExceptionCode, rtThrow, rtPrintExceptionDetails

RTresult RTAPI rtContextSetMaxCallableProgramDepth ( RTcontext  context,
unsigned int  maxDepth 
)

Set maximum callable program call depth for a given context.

Description

rtContextSetMaxCallableProgramDepth sets the maximum call depth of a chain of callable programs for the given context to maxDepth. This value is only used for stack size computation. Only supported for RTX execution mode. Default value is 5. Returns RT_ERROR_INVALID_VALUE if context is not valid.

Parameters
[in]contextThe context node to be modified
[in]maxDepthThe desired maximum depth

Return values

Relevant return values:

History

rtContextSetMaxCallableProgramDepth was introduced in OptiX 6.0

See also rtContextGetMaxCallableProgramDepth

RTresult RTAPI rtContextSetMaxTraceDepth ( RTcontext  context,
unsigned int  maxDepth 
)

Set the maximum trace depth for a given context.

Description

rtContextSetMaxTraceDepth sets the maximum trace depth for the given context to maxDepth. Only supported for RTX execution mode. Default value is 5. Returns RT_ERROR_INVALID_VALUE if context is not valid.

Parameters
[in]contextThe context node to be modified
[in]maxDepthThe desired maximum depth

Return values

Relevant return values:

History

rtContextSetMaxTraceDepth was introduced in OptiX 6.0

See also rtContextGetMaxTraceDepth

RTresult RTAPI rtContextSetMissProgram ( RTcontext  context,
unsigned int  rayTypeIndex,
RTprogram  program 
)

Specifies the miss program for a given context ray type.

Description

rtContextSetMissProgram sets context's miss program associated with ray type rayTypeIndex. RT_ERROR_INVALID_VALUE is returned if rayTypeIndex is outside of the range [0, rtContextGetRayTypeCount -1].

Parameters
[in]contextThe context node to which the miss program will be added
[in]rayTypeIndexThe ray type the program will be associated with
[in]programThe miss program

Return values

Relevant return values:

History

rtContextSetMissProgram was introduced in OptiX 1.0.

See also rtContextGetRayTypeCount, rtContextGetMissProgram

RTresult RTAPI rtContextSetPrintBufferSize ( RTcontext  context,
RTsize  bufferSizeBytes 
)

Set the size of the print buffer.

Description

rtContextSetPrintBufferSize is used to set the buffer size available to hold data generated by rtPrintf. Returns RT_ERROR_INVALID_VALUE if it is called after the first invocation of rtContextLaunch.

Parameters
[in]contextThe context for which to set the print buffer size
[in]bufferSizeBytesThe print buffer size in bytes

Return values

Relevant return values:

History

rtContextSetPrintBufferSize was introduced in OptiX 1.0.

See also rtPrintf, rtContextSetPrintEnabled, rtContextGetPrintEnabled, rtContextGetPrintBufferSize, rtContextSetPrintLaunchIndex, rtContextGetPrintLaunchIndex

RTresult RTAPI rtContextSetPrintEnabled ( RTcontext  context,
int  enabled 
)

Enable or disable text printing from programs.

Description

rtContextSetPrintEnabled is used to control whether text printing in programs through rtPrintf is currently enabled for this context.

Parameters
[in]contextThe context for which printing is to be enabled or disabled
[in]enabledSetting this parameter to a nonzero value enables printing, 0 disables printing

Return values

Relevant return values:

History

rtContextSetPrintEnabled was introduced in OptiX 1.0.

See also rtPrintf, rtContextGetPrintEnabled, rtContextSetPrintBufferSize, rtContextGetPrintBufferSize, rtContextSetPrintLaunchIndex, rtContextGetPrintLaunchIndex

RTresult RTAPI rtContextSetPrintLaunchIndex ( RTcontext  context,
int  x,
int  y,
int  z 
)

Sets the active launch index to limit text output.

Description

rtContextSetPrintLaunchIndex is used to control for which launch indices rtPrintf generates output. The initial value of (x,y,z) is (-1,-1,-1), which generates output for all indices.

Parameters
[in]contextThe context for which to set the print launch index
[in]xThe launch index in the x dimension to which to limit the output of rtPrintf invocations. If set to -1, output is generated for all launch indices in the x dimension
[in]yThe launch index in the y dimension to which to limit the output of rtPrintf invocations. If set to -1, output is generated for all launch indices in the y dimension
[in]zThe launch index in the z dimension to which to limit the output of rtPrintf invocations. If set to -1, output is generated for all launch indices in the z dimension

Return values

Relevant return values:

History

rtContextSetPrintLaunchIndex was introduced in OptiX 1.0.

See also rtPrintf, rtContextGetPrintEnabled, rtContextSetPrintEnabled, rtContextSetPrintBufferSize, rtContextGetPrintBufferSize, rtContextGetPrintLaunchIndex

RTresult RTAPI rtContextSetRayGenerationProgram ( RTcontext  context,
unsigned int  entryPointIndex,
RTprogram  program 
)

Specifies the ray generation program for a given context entry point.

Description

rtContextSetRayGenerationProgram sets context's ray generation program at entry point entryPointIndex. RT_ERROR_INVALID_VALUE is returned if entryPointIndex is outside of the range [0, rtContextGetEntryPointCount -1].

Parameters
[in]contextThe context node to which the exception program will be added
[in]entryPointIndexThe entry point the program will be associated with
[in]programThe ray generation program

Return values

Relevant return values:

History

rtContextSetRayGenerationProgram was introduced in OptiX 1.0.

See also rtContextGetEntryPointCount, rtContextGetRayGenerationProgram

RTresult RTAPI rtContextSetRayTypeCount ( RTcontext  context,
unsigned int  rayTypeCount 
)

Sets the number of ray types for a given context.

Description

rtContextSetRayTypeCount Sets the number of ray types associated with the given context.

Parameters
[in]contextThe context node
[in]rayTypeCountThe number of ray types to be used

Return values

Relevant return values:

History

rtContextSetRayTypeCount was introduced in OptiX 1.0.

See also rtContextGetRayTypeCount

RTresult RTAPI rtContextSetStackSize ( RTcontext  context,
RTsize  bytes 
)

Set the stack size for a given context.

Description

rtContextSetStackSize sets the stack size for the given context to bytes bytes. Not supported with the RTX execution strategy. With RTX execution strategy rtContextSetMaxTraceDepth and rtContextSetMaxCallableDepth should be used to control stack size. Returns RT_ERROR_INVALID_VALUE if context is not valid.

Parameters
[in]contextThe context node to be modified
[in]bytesThe desired stack size in bytes

Return values

Relevant return values:

History

rtContextSetStackSize was introduced in OptiX 1.0.

See also rtContextGetStackSize

RTresult RTAPI rtContextSetTimeoutCallback ( RTcontext  context,
RTtimeoutcallback  callback,
double  minPollingSeconds 
)

Deprecated in OptiX 6.0. Calling this function has no effect.

RTresult RTAPI rtContextSetUsageReportCallback ( RTcontext  context,
RTusagereportcallback  callback,
int  verbosity,
void *  cbdata 
)

Set usage report callback function.

Description

rtContextSetUsageReportCallback sets an application-side callback function callback and a verbosity level verbosity.

RTusagereportcallback is defined as void (RTusagereportcallback)(int, const char, const char*, void*).

The provided callback will be invoked with the message's verbosity level as the first parameter. The second parameter is a descriptive tag string and the third parameter is the message itself. The fourth parameter is a pointer to user-defined data, which may be NULL. The descriptive tag will give a terse message category description (eg, 'SCENE STAT'). The messages will be unstructured and subject to change with subsequent releases. The verbosity argument specifies the granularity of these messages.

verbosity of 0 disables reporting. callback is ignored in this case.

verbosity of 1 enables error messages and important warnings. This verbosity level can be expected to be efficient and have no significant overhead.

verbosity of 2 additionally enables minor warnings, performance recommendations, and scene statistics at startup or recompilation granularity. This level may have a performance cost.

verbosity of 3 additionally enables informational messages and per-launch statistics and messages.

A NULL callback when verbosity is non-zero or a verbosity outside of [0, 3] will result in RT_ERROR_INVALID_VALUE return code.

Only one report callback function can be specified at any time.

Parameters
[in]contextThe context node to be modified
[in]callbackThe function to be called
[in]verbosityThe verbosity of report messages
[in]cbdataPointer to user-defined data that will be sent to the callback. Can be NULL.

Return values

Relevant return values:

History

rtContextSetUsageReportCallback was introduced in OptiX 5.0.

See also

RTresult RTAPI rtContextStopProgressive ( RTcontext  context)

Stops a Progressive Launch.

Description

If a progressive launch is currently in progress, calling rtContextStopProgressive terminates it. Otherwise, the call has no effect. If a launch is stopped using this function, no further subframes will arrive at the client, even if they have already been generated by the server and are currently in flight.

This call should only be used if the application must guarantee that frames generated by previous progressive launches won't be accessed. Do not call rtContextStopProgressive in the main rendering loop if the goal is only to change OptiX state (e.g. rtVariable values). The call is unnecessary in that case and will degrade performance.

Parameters
[in]contextThe context associated with the progressive launch

Return values

Relevant return values:

History

rtContextStopProgressive was introduced in OptiX 3.8.

See also rtContextLaunchProgressive2D

RTresult RTAPI rtContextValidate ( RTcontext  context)

Checks the given context for valid internal state.

Description

rtContextValidate checks the the given context and all of its associated OptiX objects for a valid state. These checks include tests for presence of necessary programs (e.g. an intersection program for a geometry node), invalid internal state such as NULL children in graph nodes, and presence of variables required by all specified programs. rtContextGetErrorString can be used to retrieve a description of a validation failure.

Parameters
[in]contextThe context to be validated

Return values

Relevant return values:

History

rtContextValidate was introduced in OptiX 1.0.

See also rtContextGetErrorString

RTresult RTAPI rtDeviceGetAttribute ( int  ordinal,
RTdeviceattribute  attrib,
RTsize  size,
void *  p 
)

Returns an attribute specific to an OptiX device.

Description

rtDeviceGetAttribute returns in p the value of the per device attribute specified by attrib for device ordinal.

Each attribute can have a different size. The sizes are given in the following list:

For RT_DEVICE_ATTRIBUTE_COMPATIBLE_DEVICES, the first int returned is the number of compatible device ordinals returned. A device is always compatible with itself, so the count will always be at least one. Size the output buffer based on the number of devices as returned by rtDeviceGetDeviceCount.

Parameters
[in]ordinalOptiX device ordinal
[in]attribAttribute to query
[in]sizeSize of the attribute being queried. Parameter p must have at least this much memory allocated
[out]pReturn pointer where the value of the attribute will be copied into. This must point to at least size bytes of memory

Return values

Relevant return values:

  • RT_SUCCESS
  • RT_ERROR_INVALID_VALUE - Can be returned if size does not match the proper size of the attribute, if p is NULL, or if ordinal does not correspond to an OptiX device

History

rtDeviceGetAttribute was introduced in OptiX 2.0. RT_DEVICE_ATTRIBUTE_TCC_DRIVER was introduced in OptiX 3.0. RT_DEVICE_ATTRIBUTE_CUDA_DEVICE_ORDINAL was introduced in OptiX 3.0. RT_DEVICE_ATTRIBUTE_COMPATIBLE_DEVICES was introduced in OptiX 6.0.

See also rtDeviceGetDeviceCount, rtContextGetAttribute

RTresult RTAPI rtDeviceGetDeviceCount ( unsigned int *  count)

Returns the number of OptiX capable devices.

Description

rtDeviceGetDeviceCount returns in count the number of compute devices that are available in the host system and will be used by OptiX.

Parameters
[out]countNumber devices available for OptiX

Return values

Relevant return values:

History

rtDeviceGetDeviceCount was introduced in OptiX 1.0.

See also rtGetVersion

RTresult RTAPI rtGeometryCreate ( RTcontext  context,
RTgeometry geometry 
)

Creates a new geometry node.

Description

rtGeometryCreate creates a new geometry node within a context. context specifies the target context, and should be a value returned by rtContextCreate. Sets *geometry to the handle of a newly created geometry within context. Returns RT_ERROR_INVALID_VALUE if geometry is NULL.

Parameters
[in]contextSpecifies the rendering context of the Geometry node
[out]geometryNew Geometry node handle

Return values

Relevant return values:

History

rtGeometryCreate was introduced in OptiX 1.0.

See also rtGeometryDestroy, rtGeometrySetBoundingBoxProgram, rtGeometrySetIntersectionProgram

RTresult RTAPI rtGeometryDeclareVariable ( RTgeometry  geometry,
const char *  name,
RTvariable v 
)

Declares a new named variable associated with a geometry instance.

Description

rtGeometryDeclareVariable declares a new variable associated with a geometry node. geometry specifies the target geometry node, and should be a value returned by rtGeometryCreate. name specifies the name of the variable, and should be a NULL-terminated string. If there is currently no variable associated with geometry named name, a new variable named name will be created and associated with geometry. Returns the handle of the newly-created variable in *v or NULL otherwise. After declaration, the variable can be queried with rtGeometryQueryVariable or rtGeometryGetVariable. A declared variable does not have a type until its value is set with one of the rtVariableSet functions. Once a variable is set, its type cannot be changed anymore.

Parameters
[in]geometrySpecifies the associated Geometry node
[in]nameThe name that identifies the variable
[out]vReturns a handle to a newly declared variable

Return values

Relevant return values:

History

rtGeometryDeclareVariable was introduced in OptiX 1.0.

See also Variables, rtGeometryQueryVariable, rtGeometryGetVariable, rtGeometryRemoveVariable

RTresult RTAPI rtGeometryDestroy ( RTgeometry  geometry)

Destroys a geometry node.

Description

rtGeometryDestroy removes geometry from its context and deletes it. geometry should be a value returned by rtGeometryCreate. Associated variables declared via rtGeometryDeclareVariable are destroyed, but no child graph nodes are destroyed. After the call, geometry is no longer a valid handle.

Parameters
[in]geometryHandle of the geometry node to destroy

Return values

Relevant return values:

History

rtGeometryDestroy was introduced in OptiX 1.0.

See also rtGeometryCreate, rtGeometrySetPrimitiveCount, rtGeometryGetPrimitiveCount

RTresult RTAPI rtGeometryGetBoundingBoxProgram ( RTgeometry  geometry,
RTprogram program 
)

Returns the attached bounding box program.

Description

rtGeometryGetBoundingBoxProgram returns the handle program for the attached bounding box program of geometry.

Parameters
[in]geometryGeometry node handle from which to query program
[out]programHandle to attached bounding box program

Return values

Relevant return values:

History

rtGeometryGetBoundingBoxProgram was introduced in OptiX 1.0.

See also rtGeometrySetBoundingBoxProgram

RTresult RTAPI rtGeometryGetContext ( RTgeometry  geometry,
RTcontext context 
)

Returns the context associated with a geometry node.

Description

rtGeometryGetContext queries a geometry node for its associated context. geometry specifies the geometry node to query, and should be a value returned by rtGeometryCreate. Sets *context to the context associated with geometry.

Parameters
[in]geometrySpecifies the geometry to query
[out]contextThe context associated with geometry

Return values

Relevant return values:

History

rtGeometryGetContext was introduced in OptiX 1.0.

See also rtGeometryCreate

RTresult RTAPI rtGeometryGetFlags ( RTgeometry  geometry,
RTgeometryflags flags 
)

Retrieves geometry flags.

Description

See rtGeometrySetFlags for details.

Parameters
[in]geometryThe group handle
[out]flagsFlags for the given geometry group

Return values

Relevant return values:

History

rtGeometryGetFlags was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetFlagsPerMaterial, rtTrace

RTresult RTAPI rtGeometryGetIntersectionProgram ( RTgeometry  geometry,
RTprogram program 
)

Returns the attached intersection program.

Description

rtGeometryGetIntersectionProgram returns in program a handle of the attached intersection program.

Parameters
[in]geometryGeometry node handle to query program
[out]programHandle to attached intersection program

Return values

Relevant return values:

History

rtGeometryGetIntersectionProgram was introduced in OptiX 1.0.

See also rtGeometrySetIntersectionProgram, rtProgramCreateFromPTXFile, rtProgramCreateFromPTXString

RTresult RTAPI rtGeometryGetMotionBorderMode ( RTgeometry  geometry,
RTmotionbordermode beginMode,
RTmotionbordermode endMode 
)

Returns the motion border modes of a Geometry node.

Description rtGeometryGetMotionBorderMode returns the motion border modes for the time range associated with geometry.

Parameters
[in]geometryGeometry node handle
[out]beginModeMotion border mode at motion range begin
[out]endModeMotion border mode at motion range end

Return values

Relevant return values:

History

rtGeometryGetMotionBorderMode was introduced in OptiX 5.0.

See also rtGeometrySetMotionBorderMode rtGeometryGetMotionRange rtGeometryGetMotionSteps

RTresult RTAPI rtGeometryGetMotionRange ( RTgeometry  geometry,
float *  timeBegin,
float *  timeEnd 
)

Returns the motion time range associated with a Geometry node.

Description rtGeometryGetMotionRange returns the motion time range associated with geometry from a previous call to rtGeometrySetMotionRange, or the default values of [0.0, 1.0].

Parameters
[in]geometryGeometry node handle
[out]timeBeginBeginning time value of range
[out]timeEndEnding time value of range

Return values

Relevant return values:

History

rtGeometryGetMotionRange was introduced in OptiX 5.0.

See also rtGeometrySetMotionRange rtGeometryGetMotionBorderMode rtGeometryGetMotionSteps

RTresult RTAPI rtGeometryGetMotionSteps ( RTgeometry  geometry,
unsigned int *  n 
)

Returns the number of motion steps associated with a Geometry node.

Description rtGeometryGetMotionSteps returns in n the number of motion steps associated with geometry. Note that the default value is 1, not 0, for geometry without motion.

Parameters
[in]geometryGeometry node handle
[out]nNumber of motion steps n >= 1

Return values

Relevant return values:

History

rtGeometryGetMotionSteps was introduced in OptiX 5.0.

See also rtGeometryGetMotionSteps rtGeometrySetMotionBorderMode rtGeometrySetMotionRange

RTresult RTAPI rtGeometryGetPrimitiveCount ( RTgeometry  geometry,
unsigned int *  primitiveCount 
)

Returns the number of primitives.

Description

rtGeometryGetPrimitiveCount returns for geometry the number of set primitives. The number of primitvies can be set with rtGeometryGetPrimitiveCount.

Parameters
[in]geometryGeometry node to query from the number of primitives
[out]primitiveCountNumber of primitives

Return values

Relevant return values:

History

rtGeometryGetPrimitiveCount was introduced in OptiX 1.0.

See also rtGeometrySetPrimitiveCount

RTresult RTAPI rtGeometryGetPrimitiveIndexOffset ( RTgeometry  geometry,
unsigned int *  indexOffset 
)

Returns the current primitive index offset.

Description

rtGeometryGetPrimitiveIndexOffset returns for geometry the primitive index offset. The primitive index offset can be set with rtGeometrySetPrimitiveIndexOffset.

Parameters
[in]geometryGeometry node to query for the primitive index offset
[out]indexOffsetPrimitive index offset

Return values

Relevant return values:

History

rtGeometryGetPrimitiveIndexOffset was introduced in OptiX 3.5.

See also rtGeometrySetPrimitiveIndexOffset

RTresult RTAPI rtGeometryGetVariable ( RTgeometry  geometry,
unsigned int  index,
RTvariable v 
)

Returns a handle to an indexed variable of a geometry node.

Description

rtGeometryGetVariable queries the handle of a geometry node's indexed variable. geometry specifies the target geometry and should be a value returned by rtGeometryCreate. index specifies the index of the variable, and should be a value less than rtGeometryGetVariableCount. If index is the index of a variable attached to geometry, returns its handle in *v or NULL otherwise. *v must be declared first with rtGeometryDeclareVariable before it can be queried.

Parameters
[in]geometryThe geometry node from which to query a variable
[in]indexThe index that identifies the variable to be queried
[out]vReturns handle to indexed variable

Return values

Relevant return values:

History

rtGeometryGetVariable was introduced in OptiX 1.0.

See also rtGeometryDeclareVariable, rtGeometryGetVariableCount, rtGeometryRemoveVariable, rtGeometryQueryVariable

RTresult RTAPI rtGeometryGetVariableCount ( RTgeometry  geometry,
unsigned int *  count 
)

Returns the number of attached variables.

Description

rtGeometryGetVariableCount queries the number of variables attached to a geometry node. geometry specifies the geometry node, and should be a value returned by rtGeometryCreate. After the call, the number of variables attached to geometry is returned to *count.

Parameters
[in]geometryThe Geometry node to query from the number of attached variables
[out]countReturns the number of attached variables

Return values

Relevant return values:

History

rtGeometryGetVariableCount was introduced in OptiX 1.0.

See also rtGeometryGetVariableCount, rtGeometryDeclareVariable, rtGeometryRemoveVariable

RTresult RTAPI rtGeometryGroupCreate ( RTcontext  context,
RTgeometrygroup geometrygroup 
)

Creates a new geometry group.

Description

rtGeometryGroupCreate creates a new geometry group within a context. context specifies the target context, and should be a value returned by rtContextCreate. Sets *geometrygroup to the handle of a newly created geometry group within context. Returns RT_ERROR_INVALID_VALUE if geometrygroup is NULL.

Parameters
[in]contextSpecifies a context within which to create a new geometry group
[out]geometrygroupReturns a newly created geometry group

Return values

Relevant return values:

History

rtGeometryGroupCreate was introduced in OptiX 1.0.

See also rtGeometryGroupDestroy, rtContextCreate

RTresult RTAPI rtGeometryGroupDestroy ( RTgeometrygroup  geometrygroup)

Destroys a geometry group node.

Description

rtGeometryGroupDestroy removes geometrygroup from its context and deletes it. geometrygroup should be a value returned by rtGeometryGroupCreate. No child graph nodes are destroyed. After the call, geometrygroup is no longer a valid handle.

Parameters
[in]geometrygroupHandle of the geometry group node to destroy

Return values

Relevant return values:

History

rtGeometryGroupDestroy was introduced in OptiX 1.0.

See also rtGeometryGroupCreate

RTresult RTAPI rtGeometryGroupGetAcceleration ( RTgeometrygroup  geometrygroup,
RTacceleration acceleration 
)

Returns the acceleration structure attached to a geometry group.

Description

rtGeometryGroupGetAcceleration returns the acceleration structure attached to a geometry group using rtGeometryGroupSetAcceleration. If no acceleration structure has previously been set, *acceleration is set to NULL.

Parameters
[in]geometrygroupThe geometry group handle
[out]accelerationThe returned acceleration structure object

Return values

Relevant return values:

History

rtGeometryGroupGetAcceleration was introduced in OptiX 1.0.

See also rtGeometryGroupSetAcceleration, rtAccelerationCreate

RTresult RTAPI rtGeometryGroupGetChild ( RTgeometrygroup  geometrygroup,
unsigned int  index,
RTgeometryinstance geometryinstance 
)

Returns a child node of a geometry group.

Description

rtGeometryGroupGetChild returns the child geometry instance at slot index of the parent geometrygroup. If no child has been assigned to the given slot, *geometryinstance is set to NULL. Returns RT_ERROR_INVALID_VALUE if given an invalid child index or NULL pointer.

Parameters
[in]geometrygroupThe parent geometry group handle
[in]indexThe index of the child slot to query
[out]geometryinstanceThe returned child geometry instance

Return values

Relevant return values:

History

rtGeometryGroupGetChild was introduced in OptiX 1.0.

See also rtGeometryGroupSetChild, rtGeometryGroupSetChildCount, rtGeometryGroupGetChildCount,

RTresult RTAPI rtGeometryGroupGetChildCount ( RTgeometrygroup  geometrygroup,
unsigned int *  count 
)

Returns the number of child slots for a group.

Description

rtGeometryGroupGetChildCount returns the number of child slots allocated using rtGeometryGroupSetChildCount. This includes empty slots which may not yet have actual children assigned by rtGeometryGroupSetChild.

Parameters
[in]geometrygroupThe parent geometry group handle
[out]countReturned number of child slots

Return values

Relevant return values:

History

rtGeometryGroupGetChildCount was introduced in OptiX 1.0.

See also rtGeometryGroupSetChild, rtGeometryGroupGetChild, rtGeometryGroupSetChildCount

RTresult RTAPI rtGeometryGroupGetContext ( RTgeometrygroup  geometrygroup,
RTcontext context 
)

Returns the context associated with a geometry group.

Description

rtGeometryGroupGetContext queries a geometry group for its associated context. geometrygroup specifies the geometry group to query, and must be a value returned by rtGeometryGroupCreate. Sets *context to the context associated with geometrygroup.

Parameters
[in]geometrygroupSpecifies the geometry group to query
[out]contextReturns the context associated with the geometry group

Return values

Relevant return values:

History

rtGeometryGroupGetContext was introduced in OptiX 1.0.

See also rtContextCreate, rtGeometryGroupCreate

RTresult RTAPI rtGeometryGroupGetFlags ( RTgeometrygroup  group,
RTinstanceflags flags 
)

Gets instance flags of a geometry group.

Description

See rtGeometryGroupSetFlags for details.

Parameters
[in]groupThe group handle
[out]flagsInstance flags for the given geometry group

Return values

Relevant return values:

History

rtGeometryGroupGetFlags was introduced in OptiX 6.0.

See also rtGeometryGroupSetFlags, rtTrace

RTresult RTAPI rtGeometryGroupGetVisibilityMask ( RTgeometrygroup  group,
RTvisibilitymask *  mask 
)

Gets the visibility mask of a geometry group.

Description See rtGeometryGroupSetVisibilityMask for details/

Parameters
[in]groupThe group handle
[out]maskA set of bits for which rays will intersect the group

Return values

Relevant return values:

History

rtGeometryGroupGetVisibilityMask was introduced in OptiX 6.0.

See also rtGroupGetVisibilityMask rtGeometryGroupSetVisibilityMask, rtTrace

RTresult RTAPI rtGeometryGroupSetAcceleration ( RTgeometrygroup  geometrygroup,
RTacceleration  acceleration 
)

Set the acceleration structure for a group.

Description

rtGeometryGroupSetAcceleration attaches an acceleration structure to a geometry group. The acceleration structure must have been previously created using rtAccelerationCreate. Every geometry group is required to have an acceleration structure assigned in order to pass validation. The acceleration structure will be built over the primitives contained in all children of the geometry group. This enables a single acceleration structure to be built over primitives of multiple geometry instances. Note that it is legal to attach a single RTacceleration object to multiple geometry groups, as long as the underlying geometry of all children is the same. This corresponds to attaching an acceleration structure to multiple groups at higher graph levels using rtGroupSetAcceleration.

Parameters
[in]geometrygroupThe geometry group handle
[in]accelerationThe acceleration structure to attach to the geometry group

Return values

Relevant return values:

History

rtGeometryGroupSetAcceleration was introduced in OptiX 1.0.

See also rtGeometryGroupGetAcceleration, rtAccelerationCreate, rtGroupSetAcceleration

RTresult RTAPI rtGeometryGroupSetChild ( RTgeometrygroup  geometrygroup,
unsigned int  index,
RTgeometryinstance  geometryinstance 
)

Attaches a child node to a geometry group.

Description

rtGeometryGroupSetChild attaches a new child node geometryinstance to the parent node geometrygroup. index specifies the number of the slot where the child node gets attached. The index value must be lower than the number previously set by rtGeometryGroupSetChildCount.

Parameters
[in]geometrygroupThe parent geometry group handle
[in]indexThe index in the parent's child slot array
[in]geometryinstanceThe child node to be attached

Return values

Relevant return values:

History

rtGeometryGroupSetChild was introduced in OptiX 1.0.

See also rtGeometryGroupSetChildCount, rtGeometryGroupGetChildCount, rtGeometryGroupGetChild

RTresult RTAPI rtGeometryGroupSetChildCount ( RTgeometrygroup  geometrygroup,
unsigned int  count 
)

Sets the number of child nodes to be attached to the group.

Description

rtGeometryGroupSetChildCount specifies the number of child slots in this geometry group. Potentially existing links to children at indices greater than count-1 are removed. If the call increases the number of slots, the newly created slots are empty and need to be filled using rtGeometryGroupSetChild before validation.

Parameters
[in]geometrygroupThe parent geometry group handle
[in]countNumber of child slots to allocate for the geometry group

Return values

Relevant return values:

History

rtGeometryGroupSetChildCount was introduced in OptiX 1.0.

See also rtGeometryGroupGetChild, rtGeometryGroupGetChildCount rtGeometryGroupSetChild

RTresult RTAPI rtGeometryGroupSetFlags ( RTgeometrygroup  group,
RTinstanceflags  flags 
)

Sets instance flags for a geometry group.

Description

This function controls the RTinstanceflags of the given geometry group. The flags override the RTgeometryflags of the underlying geometry where appropriate.

Parameters
[in]groupThe group handle
[in]flagsInstance flags for the given geometry group

Return values

Relevant return values:

History

rtGeometryGroupSetFlags was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetFlagsPerMaterial, rtGeometrySetFlags, rtGeometryGroupGetFlags, rtTrace

RTresult RTAPI rtGeometryGroupSetVisibilityMask ( RTgeometrygroup  group,
RTvisibilitymask  mask 
)

Sets the visibility mask of a geometry group.

Description Geometry is intersected by rays if the ray's RTvisibilitymask shares at least one bit with the geometry's mask. This mechanism allows for a number of user-defined visibility groups that can be excluded from certain types of rays as needed.

Note that the

Precondition
mask is currently limited to 8 bits.
Parameters
[in]groupThe group handle
[in]maskA set of bits for which rays will intersect the group

Return values

Relevant return values:

History

rtGeometryGroupSetVisibilityMask was introduced in OptiX 6.0.

See also rtGroupSetVisibilityMask rtGeometryGroupGetVisibilityMask, rtTrace

RTresult RTAPI rtGeometryGroupValidate ( RTgeometrygroup  geometrygroup)

Validates the state of the geometry group.

Description

rtGeometryGroupValidate checks geometrygroup for completeness. If geometrygroup or any of the objects attached to geometrygroup are not valid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]geometrygroupSpecifies the geometry group to be validated

Return values

Relevant return values:

History

rtGeometryGroupValidate was introduced in OptiX 1.0.

See also rtGeometryGroupCreate

RTresult RTAPI rtGeometryInstanceCreate ( RTcontext  context,
RTgeometryinstance geometryinstance 
)

Creates a new geometry instance node.

Description

rtGeometryInstanceCreate creates a new geometry instance node within a context. context specifies the target context, and should be a value returned by rtContextCreate. Sets *geometryinstance to the handle of a newly created geometry instance within context. Returns RT_ERROR_INVALID_VALUE if geometryinstance is NULL.

Parameters
[in]contextSpecifies the rendering context of the GeometryInstance node
[out]geometryinstanceNew GeometryInstance node handle

Return values

Relevant return values:

History

rtGeometryInstanceCreate was introduced in OptiX 1.0.

See also rtGeometryInstanceDestroy, rtGeometryInstanceDestroy, rtGeometryInstanceGetContext

RTresult RTAPI rtGeometryInstanceDeclareVariable ( RTgeometryinstance  geometryinstance,
const char *  name,
RTvariable v 
)

Declares a new named variable associated with a geometry node.

Description

rtGeometryInstanceDeclareVariable declares a new variable associated with a geometry instance node. geometryinstance specifies the target geometry node, and should be a value returned by rtGeometryInstanceCreate. name specifies the name of the variable, and should be a NULL-terminated string. If there is currently no variable associated with geometryinstance named name, a new variable named name will be created and associated with geometryinstance. After the call, *v will be set to the handle of the newly-created variable. Otherwise, *v will be set to NULL. After declaration, the variable can be queried with rtGeometryInstanceQueryVariable or rtGeometryInstanceGetVariable. A declared variable does not have a type until its value is set with one of the rtVariableSet functions. Once a variable is set, its type cannot be changed anymore.

Parameters
[in]geometryinstanceSpecifies the associated GeometryInstance node
[in]nameThe name that identifies the variable
[out]vReturns a handle to a newly declared variable

Return values

Relevant return values:

History

rtGeometryInstanceDeclareVariable was introduced in OptiX 1.0.

See also Variables, rtGeometryInstanceQueryVariable, rtGeometryInstanceGetVariable, rtGeometryInstanceRemoveVariable

RTresult RTAPI rtGeometryInstanceDestroy ( RTgeometryinstance  geometryinstance)

Destroys a geometry instance node.

Description

rtGeometryInstanceDestroy removes geometryinstance from its context and deletes it. geometryinstance should be a value returned by rtGeometryInstanceCreate. Associated variables declared via rtGeometryInstanceDeclareVariable are destroyed, but no child graph nodes are destroyed. After the call, geometryinstance is no longer a valid handle.

Parameters
[in]geometryinstanceHandle of the geometry instance node to destroy

Return values

Relevant return values:

History

rtGeometryInstanceDestroy was introduced in OptiX 1.0.

See also rtGeometryInstanceCreate

RTresult RTAPI rtGeometryInstanceGetContext ( RTgeometryinstance  geometryinstance,
RTcontext context 
)

Returns the context associated with a geometry instance node.

Description

rtGeometryInstanceGetContext queries a geometry instance node for its associated context. geometryinstance specifies the geometry node to query, and should be a value returned by rtGeometryInstanceCreate. Sets *context to the context associated with geometryinstance.

Parameters
[in]geometryinstanceSpecifies the geometry instance
[out]contextHandle for queried context

Return values

Relevant return values:

History

rtGeometryInstanceGetContext was introduced in OptiX 1.0.

See also rtGeometryInstanceGetContext

RTresult RTAPI rtGeometryInstanceGetGeometry ( RTgeometryinstance  geometryinstance,
RTgeometry geometry 
)

Returns the attached Geometry node.

Description

rtGeometryInstanceGetGeometry sets geometry to the handle of the attached Geometry node. Only one GeometryTriangles or Geometry node can be attached to a GeometryInstance at a time.

Parameters
[in]geometryinstanceGeometryInstance node handle to query geometry
[out]geometryHandle to attached Geometry node

Return values

Relevant return values:

History

rtGeometryInstanceGetGeometry was introduced in OptiX 1.0.

See also rtGeometryInstanceCreate, rtGeometryInstanceDestroy, rtGeometryInstanceValidate, rtGeometryInstanceSetGeometry rtGeometryInstanceSetGeometryTriangles rtGeometryInstanceGetGeometryTriangles

RTresult RTAPI rtGeometryInstanceGetGeometryTriangles ( RTgeometryinstance  geometryinstance,
RTgeometrytriangles geometrytriangles 
)

Returns the attached Geometry node.

Description

rtGeometryInstanceGetGeometryTriangles sets geometrytriangles to the handle of the attached GeometryTriangles node. If no GeometryTriangles node is attached or a Geometry node is attached, RT_ERROR_INVALID_VALUE is returned, else RT_SUCCESS.

Parameters
[in]geometryinstanceGeometryInstance node handle to query geometrytriangles
[out]geometrytrianglesHandle to attached GeometryTriangles node

Return values

Relevant return values:

History

rtGeometryInstanceGetGeometryTriangles was introduced in OptiX 6.0.

See also rtGeometryInstanceCreate, rtGeometryInstanceDestroy, rtGeometryInstanceValidate, rtGeometryInstanceSetGeometryTriangles rtGeometryInstanceSetGeometry rtGeometryInstanceGetGeometry

RTresult RTAPI rtGeometryInstanceGetMaterial ( RTgeometryinstance  geometryinstance,
unsigned int  index,
RTmaterial material 
)

Returns a material handle.

Description

rtGeometryInstanceGetMaterial returns handle material for the Material node at position index in the material list of geometryinstance. Returns RT_ERROR_INVALID_VALUE if index is invalid.

Parameters
[in]geometryinstanceGeometryInstance node handle to query material
[in]indexIndex of material
[out]materialHandle to material

Return values

Relevant return values:

History

rtGeometryInstanceGetMaterial was introduced in OptiX 1.0.

See also rtGeometryInstanceGetMaterialCount, rtGeometryInstanceSetMaterial

RTresult RTAPI rtGeometryInstanceGetMaterialCount ( RTgeometryinstance  geometryinstance,
unsigned int *  count 
)

Returns the number of attached materials.

Description

rtGeometryInstanceGetMaterialCount returns for geometryinstance the number of attached Material nodes count. The number of materials can be set with rtGeometryInstanceSetMaterialCount.

Parameters
[in]geometryinstanceGeometryInstance node to query from the number of materials
[out]countNumber of attached materials

Return values

Relevant return values:

History

rtGeometryInstanceGetMaterialCount was introduced in OptiX 1.0.

See also rtGeometryInstanceSetMaterialCount

RTresult RTAPI rtGeometryInstanceGetVariable ( RTgeometryinstance  geometryinstance,
unsigned int  index,
RTvariable v 
)

Returns a handle to an indexed variable of a geometry instance node.

Description

rtGeometryInstanceGetVariable queries the handle of a geometry instance's indexed variable. geometryinstance specifies the target geometry instance and should be a value returned by rtGeometryInstanceCreate. index specifies the index of the variable, and should be a value less than rtGeometryInstanceGetVariableCount. If index is the index of a variable attached to geometryinstance, returns a handle to that variable in *v, and NULL otherwise. *v must be declared first with rtGeometryInstanceDeclareVariable before it can be queried.

Parameters
[in]geometryinstanceThe GeometryInstance node from which to query a variable
[in]indexThe index that identifies the variable to be queried
[out]vReturns handle to indexed variable

Return values

Relevant return values:

History

rtGeometryInstanceGetVariable was introduced in OptiX 1.0.

See also rtGeometryDeclareVariable, rtGeometryGetVariableCount, rtGeometryRemoveVariable, rtGeometryQueryVariable

RTresult RTAPI rtGeometryInstanceGetVariableCount ( RTgeometryinstance  geometryinstance,
unsigned int *  count 
)

Returns the number of attached variables.

Description

rtGeometryInstanceGetVariableCount queries the number of variables attached to a geometry instance. geometryinstance specifies the geometry instance, and should be a value returned by rtGeometryInstanceCreate. After the call, the number of variables attached to geometryinstance is returned to *count.

Parameters
[in]geometryinstanceThe GeometryInstance node to query from the number of attached variables
[out]countReturns the number of attached variables

Return values

Relevant return values:

History

rtGeometryInstanceGetVariableCount was introduced in OptiX 1.0.

See also rtGeometryInstanceGetVariableCount, rtGeometryInstanceDeclareVariable, rtGeometryInstanceRemoveVariable

RTresult RTAPI rtGeometryInstanceQueryVariable ( RTgeometryinstance  geometryinstance,
const char *  name,
RTvariable v 
)

Returns a handle to a named variable of a geometry node.

Description

rtGeometryInstanceQueryVariable queries the handle of a geometry instance node's named variable. geometryinstance specifies the target geometry instance node, as returned by rtGeometryInstanceCreate. name specifies the name of the variable, and should be a NULL -terminated string. If name is the name of a variable attached to geometryinstance, returns a handle to that variable in *v, otherwise NULL. Geometry instance variables have to be declared with rtGeometryInstanceDeclareVariable before they can be queried.

Parameters
[in]geometryinstanceThe GeometryInstance node to query from a variable
[in]nameThe name that identifies the variable to be queried
[out]vReturns the named variable

Return values

Relevant return values:

History

rtGeometryInstanceQueryVariable was introduced in OptiX 1.0.

See also rtGeometryInstanceDeclareVariable, rtGeometryInstanceRemoveVariable, rtGeometryInstanceGetVariableCount, rtGeometryInstanceGetVariable

RTresult RTAPI rtGeometryInstanceRemoveVariable ( RTgeometryinstance  geometryinstance,
RTvariable  v 
)

Removes a named variable from a geometry instance node.

Description

rtGeometryInstanceRemoveVariable removes a named variable from a geometry instance. The target geometry instance is specified by geometryinstance, which should be a value returned by rtGeometryInstanceCreate. The variable to be removed is specified by v, which should be a value returned by rtGeometryInstanceDeclareVariable. Once a variable has been removed from this geometry instance, another variable with the same name as the removed variable may be declared.

Parameters
[in]geometryinstanceThe GeometryInstance node from which to remove a variable
[in]vThe variable to be removed

Return values

Relevant return values:

History

rtGeometryInstanceRemoveVariable was introduced in OptiX 1.0.

See also rtContextRemoveVariable, rtGeometryInstanceDeclareVariable

RTresult RTAPI rtGeometryInstanceSetGeometry ( RTgeometryinstance  geometryinstance,
RTgeometry  geometry 
)

Attaches a Geometry node.

Description

rtGeometryInstanceSetGeometry attaches a Geometry node to a GeometryInstance. Only one GeometryTriangles or Geometry node can be attached to a GeometryInstance at a time. However, it is possible at any time to attach a different GeometryTriangles or Geometry via rtGeometryInstanceSetGeometryTriangles or rtGeometryInstanceSetGeometry respectively.

Parameters
[in]geometryinstanceGeometryInstance node handle to attach geometry to
[in]geometryGeometry handle to attach to geometryinstance

Return values

Relevant return values:

History

rtGeometryInstanceSetGeometry was introduced in OptiX 1.0.

See also rtGeometryInstanceGetGeometry rtGeometryInstanceGetGeometryTriangles rtGeometryInstanceSetGeometryTriangles

RTresult RTAPI rtGeometryInstanceSetGeometryTriangles ( RTgeometryinstance  geometryinstance,
RTgeometrytriangles  geometrytriangles 
)

Attaches a Geometry node.

Description

rtGeometryInstanceSetGeometryTriangles attaches a GeometryTriangles node to a GeometryInstance. Only one GeometryTriangles or Geometry node can be attached to a GeometryInstance at a time. However, it is possible at any time to attach a different GeometryTriangles or Geometry via rtGeometryInstanceSetGeometryTriangles or rtGeometryInstanceSetGeometry respectively.

Parameters
[in]geometryinstanceGeometryInstance node handle to attach geometrytriangles to
[in]geometrytrianglesGeometryTriangles handle to attach to geometryinstance

Return values

Relevant return values:

History

rtGeometryInstanceSetGeometryTriangles was introduced in OptiX 6.0.

See also rtGeometryInstanceGetGeometryTriangles rtGeometryInstanceSetGeometry rtGeometryInstanceGetGeometry

RTresult RTAPI rtGeometryInstanceSetMaterial ( RTgeometryinstance  geometryinstance,
unsigned int  index,
RTmaterial  material 
)

Sets a material.

Description

rtGeometryInstanceSetMaterial attaches material to geometryinstance at position index in its internal Material node list. index must be in the range 0 to rtGeometryInstanceGetMaterialCount - 1.

Parameters
[in]geometryinstanceGeometryInstance node for which to set a material
[in]indexIndex into the material list
[in]materialMaterial handle to attach to geometryinstance

Return values

Relevant return values:

History

rtGeometryInstanceSetMaterial was introduced in OptiX 1.0.

See also rtGeometryInstanceGetMaterialCount, rtGeometryInstanceSetMaterialCount

RTresult RTAPI rtGeometryInstanceSetMaterialCount ( RTgeometryinstance  geometryinstance,
unsigned int  count 
)

Sets the number of materials.

Description

rtGeometryInstanceSetMaterialCount sets the number of materials count that will be attached to geometryinstance. The number of attached materials can be changed at any time. Increasing the number of materials will not modify already assigned materials. Decreasing the number of materials will not modify the remaining already assigned materials.

Parameters
[in]geometryinstanceGeometryInstance node to set number of materials
[in]countNumber of materials to be set

Return values

Relevant return values:

History

rtGeometryInstanceSetMaterialCount was introduced in OptiX 1.0.

See also rtGeometryInstanceGetMaterialCount

RTresult RTAPI rtGeometryInstanceValidate ( RTgeometryinstance  geometryinstance)

Checks a GeometryInstance node for internal consistency.

Description

rtGeometryInstanceValidate checks geometryinstance for completeness. If geomertryinstance or any of the objects attached to geometry are not valid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]geometryinstanceGeometryInstance node of a model sub-tree to be validated

Return values

Relevant return values:

History

rtGeometryInstanceValidate was introduced in OptiX 1.0.

See also rtGeometryInstanceCreate

RTresult RTAPI rtGeometryIsDirty ( RTgeometry  geometry,
int *  dirty 
)

Deprecated in OptiX 4.0. Calling this function has no effect.

RTresult RTAPI rtGeometryMarkDirty ( RTgeometry  geometry)

Deprecated in OptiX 4.0. Calling this function has no effect.

RTresult RTAPI rtGeometryQueryVariable ( RTgeometry  geometry,
const char *  name,
RTvariable v 
)

Returns a handle to a named variable of a geometry node.

Description

rtGeometryQueryVariable queries the handle of a geometry node's named variable. geometry specifies the target geometry node and should be a value returned by rtGeometryCreate. name specifies the name of the variable, and should be a NULL-terminated string. If name is the name of a variable attached to geometry, returns a handle to that variable in *v or NULL otherwise. Geometry variables must be declared with rtGeometryDeclareVariable before they can be queried.

Parameters
[in]geometryThe geometry node to query from a variable
[in]nameThe name that identifies the variable to be queried
[out]vReturns the named variable

Return values

Relevant return values:

History

rtGeometryQueryVariable was introduced in OptiX 1.0.

See also rtGeometryDeclareVariable, rtGeometryRemoveVariable, rtGeometryGetVariableCount, rtGeometryGetVariable

RTresult RTAPI rtGeometryRemoveVariable ( RTgeometry  geometry,
RTvariable  v 
)

Removes a named variable from a geometry node.

Description

rtGeometryRemoveVariable removes a named variable from a geometry node. The target geometry is specified by geometry, which should be a value returned by rtGeometryCreate. The variable to remove is specified by v, which should be a value returned by rtGeometryDeclareVariable. Once a variable has been removed from this geometry node, another variable with the same name as the removed variable may be declared.

Parameters
[in]geometryThe geometry node from which to remove a variable
[in]vThe variable to be removed

Return values

Relevant return values:

History

rtGeometryRemoveVariable was introduced in OptiX 1.0.

See also rtContextRemoveVariable

RTresult RTAPI rtGeometrySetBoundingBoxProgram ( RTgeometry  geometry,
RTprogram  program 
)

Sets the bounding box program.

Description

rtGeometrySetBoundingBoxProgram sets for geometry the program that computes an axis aligned bounding box for each attached primitive to geometry. RTprogram's can be either generated with rtProgramCreateFromPTXFile or rtProgramCreateFromPTXString. A bounding box program is mandatory for every geometry node.

If geometry has more than one motion step, set using rtGeometrySetMotionSteps, then the bounding box program must compute a bounding box per primitive and per motion step.

Parameters
[in]geometryThe geometry node for which to set the bounding box program
[in]programHandle to the bounding box program

Return values

Relevant return values:

History

rtGeometrySetBoundingBoxProgram was introduced in OptiX 1.0.

See also rtGeometryGetBoundingBoxProgram, rtProgramCreateFromPTXFile, rtProgramCreateFromPTXString

RTresult RTAPI rtGeometrySetFlags ( RTgeometry  geometry,
RTgeometryflags  flags 
)

Sets geometry flags.

Description

See rtGeometryTrianglesSetFlagsPerMaterial for a description of the behavior of the various flags.

Parameters
[in]geometryThe group handle
[out]flagsFlags for the given geometry group

Return values

Relevant return values:

History

rtGeometrySetFlags was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetFlagsPerMaterial, rtTrace

RTresult RTAPI rtGeometrySetIntersectionProgram ( RTgeometry  geometry,
RTprogram  program 
)

Sets the intersection program.

Description

rtGeometrySetIntersectionProgram sets for geometry the program that performs ray primitive intersections. RTprogram's can be either generated with rtProgramCreateFromPTXFile or rtProgramCreateFromPTXString. An intersection program is mandatory for every geometry node.

Parameters
[in]geometryThe geometry node for which to set the intersection program
[in]programA handle to the ray primitive intersection program

Return values

Relevant return values:

History

rtGeometrySetIntersectionProgram was introduced in OptiX 1.0.

See also rtGeometryGetIntersectionProgram, rtProgramCreateFromPTXFile, rtProgramCreateFromPTXString

RTresult RTAPI rtGeometrySetMotionBorderMode ( RTgeometry  geometry,
RTmotionbordermode  beginMode,
RTmotionbordermode  endMode 
)

Sets the motion border modes of a Geometry node.

Description rtGeometrySetMotionBorderMode sets the behavior of geometry outside its motion time range. Options are RT_MOTIONBORDERMODE_CLAMP or RT_MOTIONBORDERMODE_VANISH. See rtTransformSetMotionBorderMode for details.

Parameters
[in]geometryGeometry node handle
[in]beginModeMotion border mode at motion range begin
[in]endModeMotion border mode at motion range end

Return values

Relevant return values:

History

rtGeometrySetMotionBorderMode was introduced in OptiX 5.0.

See also rtGeometryGetMotionBorderMode rtGeometrySetMotionRange rtGeometrySetMotionSteps

RTresult RTAPI rtGeometrySetMotionRange ( RTgeometry  geometry,
float  timeBegin,
float  timeEnd 
)

Sets the motion time range for a Geometry node.

Description Sets the inclusive motion time range [timeBegin, timeEnd] for geometry, where timeBegin <= timeEnd. The default time range is [0.0, 1.0]. The time range has no effect unless rtGeometrySetMotionSteps is called, in which case the time steps uniformly divide the time range. See rtGeometrySetMotionSteps for additional requirements on the bounds program.

Parameters
[in]geometryGeometry node handle
[out]timeBeginBeginning time value of range
[out]timeEndEnding time value of range

Return values

Relevant return values:

History

rtGeometrySetMotionRange was introduced in OptiX 5.0.

See also rtGeometryGetMotionRange rtGeometrySetMotionBorderMode rtGeometrySetMotionSteps

RTresult RTAPI rtGeometrySetMotionSteps ( RTgeometry  geometry,
unsigned int  n 
)

Specifies the number of motion steps associated with a Geometry.

Description rtGeometrySetMotionSteps sets the number of motion steps associated with geometry. If the value of n is greater than 1, then geometry must have an associated bounding box program that takes both a primitive index and a motion index as arguments, and computes an aabb at the motion index. See rtGeometrySetBoundingBoxProgram.

Note that all Geometry has at least one 1 motion step (the default), and Geometry that linearly moves has 2 motion steps.

Parameters
[in]geometryGeometry node handle
[in]nNumber of motion steps >= 1

Return values

Relevant return values:

History

rtGeometrySetMotionSteps was introduced in OptiX 5.0.

See also rtGeometryGetMotionSteps rtGeometrySetMotionBorderMode rtGeometrySetMotionRange

RTresult RTAPI rtGeometrySetPrimitiveCount ( RTgeometry  geometry,
unsigned int  primitiveCount 
)

Sets the number of primitives.

Description

rtGeometrySetPrimitiveCount sets the number of primitives primitiveCount in geometry.

Parameters
[in]geometryThe geometry node for which to set the number of primitives
[in]primitiveCountThe number of primitives

Return values

Relevant return values:

History

rtGeometrySetPrimitiveCount was introduced in OptiX 1.0.

See also rtGeometryGetPrimitiveCount

RTresult RTAPI rtGeometrySetPrimitiveIndexOffset ( RTgeometry  geometry,
unsigned int  indexOffset 
)

Sets the primitive index offset.

Description

rtGeometrySetPrimitiveIndexOffset sets the primitive index offset indexOffset in geometry. In the past, a Geometry object's primitive index range always started at zero (i.e., a Geometry with N primitives would have a primitive index range of [0,N-1]). The index offset is used to allow Geometry objects to have primitive index ranges starting at non-zero positions (i.e., a Geometry with N primitives and an index offset of M would have a primitive index range of [M,M+N-1]). This feature enables the sharing of vertex index buffers between multiple Geometry objects.

Parameters
[in]geometryThe geometry node for which to set the primitive index offset
[in]indexOffsetThe primitive index offset

Return values

Relevant return values:

History

rtGeometrySetPrimitiveIndexOffset was introduced in OptiX 3.5.

See also rtGeometryGetPrimitiveIndexOffset

RTresult RTAPI rtGeometryTrianglesCreate ( RTcontext  context,
RTgeometrytriangles geometrytriangles 
)

Creates a new GeometryTriangles node.

Description

rtGeometryTrianglesCreate creates a new GeometryTriangles node within a context. context specifies the target context, and should be a value returned by rtContextCreate. Sets *geometrytriangles to the handle of a newly created GeometryTriangles node within context. Returns RT_ERROR_INVALID_VALUE if geometrytriangles is NULL.

Parameters
[in]contextSpecifies the rendering context of the GeometryTriangles node
[out]geometrytrianglesNew GeometryTriangles node handle

Return values

Relevant return values:

History

rtGeometryTrianglesCreate was introduced in OptiX 6.0.

See also rtGeometryTrianglesDestroy,

RTresult RTAPI rtGeometryTrianglesDeclareVariable ( RTgeometrytriangles  geometrytriangles,
const char *  name,
RTvariable v 
)

Declares a geometry variable for a GeometryTriangles object.

Description

rtGeometryTrianglesDeclareVariable declares a variable attribute of a geometrytriangles object with a specified name.

Parameters
[in]geometrytrianglesA geometry node
[in]nameThe name of the variable
[out]vA pointer to a handle to the variable

Return values

Relevant return values:

History

rtGeometryTrianglesDeclareVariable was introduced in OptiX 6.0.

See also rtGeometryTrianglesGetVariable, rtGeometryTrianglesGetVariableCount, rtGeometryTrianglesQueryVariable, rtGeometryTrianglesRemoveVariable

RTresult RTAPI rtGeometryTrianglesDestroy ( RTgeometrytriangles  geometrytriangles)

Destroys a GeometryTriangles node.

Description

rtGeometryTrianglesDestroy removes geometrytriangles from its context and deletes it. geometrytriangles should be a value returned by rtGeometryTrianglesCreate. After the call, geometrytriangles is no longer a valid handle.

Parameters
[in]geometrytrianglesHandle of the GeometryTriangles node to destroy

Return values

Relevant return values:

History

rtGeometryTrianglesDestroy was introduced in OptiX 6.0.

See also rtGeometryTrianglesCreate, rtGeometryTrianglesSetPrimitiveCount, rtGeometryTrianglesGetPrimitiveCount

RTresult RTAPI rtGeometryTrianglesGetAttributeProgram ( RTgeometrytriangles  geometrytriangles,
RTprogram program 
)

Gets the attribute program of a GeometryTriangles object.

Description

rtGeometryTrianglesGetAttributeProgram gets the attribute program of a given geometrytriangles object. If no program has been set, 0 is returned.

Parameters
[in]geometrytrianglesThe geometrytriangles node for which to set the attribute program
[out]programA pointer to a handle to the attribute program

Return values

Relevant return values:

History

rtGeometryTrianglesGetAttributeProgram was introduced in OptiX 6.0.

See also rtGeometryTrianglesDeclareVariable, rtGeometryTrianglesSetAttributeProgram, rtProgramCreateFromPTXFile, rtProgramCreateFromPTXString

RTresult RTAPI rtGeometryTrianglesGetContext ( RTgeometrytriangles  geometrytriangles,
RTcontext context 
)

Returns the context associated with a GeometryTriangles node.

Description

rtGeometryTrianglesGetContext queries a GeometryTriangles node for its associated context. geometrytriangles specifies the GeometryTriangles node to query, and should be a value returned by rtGeometryTrianglesCreate. Sets *context to the context associated with geometrytriangles.

Parameters
[in]geometrytrianglesSpecifies the GeometryTriangles to query
[out]contextThe context associated with geometrytriangles

Return values

Relevant return values:

History

rtGeometryTrianglesGetContext was introduced in OptiX 6.0.

See also rtGeometryTrianglesCreate

RTresult RTAPI rtGeometryTrianglesGetFlagsPerMaterial ( RTgeometrytriangles  triangles,
unsigned int  materialIndex,
RTgeometryflags flags 
)

Gets geometry flags for triangles.

Description

See rtGeometryTrianglesSetFlagsPerMaterial for details.

Parameters
[in]trianglesThe triangles handle
[in]materialIndexThe index of the material for which to retrieve the flags
[out]flagsFlags for the given geometry group

Return values

Relevant return values:

History

rtGeometryTrianglesGetFlagsPerMaterial was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetFlagsPerMaterial, rtGeometryTrianglesSetMaterialIndices rtTrace

RTresult RTAPI rtGeometryTrianglesGetMaterialCount ( RTgeometrytriangles  geometrytriangles,
unsigned int *  numMaterials 
)

Sets the number of materials used for the GeometryTriangles.

Description rtGeometryTrianglesGetMaterialCount returns the number of materials that are used with geometrytriangles. As default there is one material slot.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[out]numMaterialsNumber of materials used with this GeometryTriangles node

Return values

Relevant return values:

History

rtGeometryTrianglesGetMaterialCount was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetMaterialCount

RTresult RTAPI rtGeometryTrianglesGetMotionBorderMode ( RTgeometrytriangles  geometrytriangles,
RTmotionbordermode beginMode,
RTmotionbordermode endMode 
)

Returns the motion border modes of a GeometryTriangles node.

Description rtGeometryTrianglesGetMotionBorderMode returns the motion border modes for the time range associated with geometrytriangles.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[out]beginModeMotion border mode at motion range begin
[out]endModeMotion border mode at motion range end

Return values

Relevant return values:

History

rtGeometryTrianglesGetMotionBorderMode was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetMotionBorderMode rtGeometryTrianglesGetMotionRange rtGeometryTrianglesGetMotionSteps

RTresult RTAPI rtGeometryTrianglesGetMotionRange ( RTgeometrytriangles  geometrytriangles,
float *  timeBegin,
float *  timeEnd 
)

Returns the motion time range associated with a GeometryTriangles node.

Description rtGeometryTrianglesGetMotionRange returns the motion time range associated with geometrytriangles from a previous call to rtGeometryTrianglesSetMotionRange, or the default values of [0.0, 1.0].

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[out]timeBeginBeginning time value of range
[out]timeEndEnding time value of range

Return values

Relevant return values:

History

rtGeometryTrianglesGetMotionRange was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetMotionRange rtGeometryTrianglesGetMotionBorderMode rtGeometryTrianglesGetMotionSteps

RTresult RTAPI rtGeometryTrianglesGetMotionSteps ( RTgeometrytriangles  geometrytriangles,
unsigned int *  motionStepCount 
)

Returns the number of motion steps associated with a GeometryTriangles node.

Description rtGeometryTrianglesGetMotionSteps returns in motionStepCount the number of motion steps associated with geometrytriangles. Note that the default value is 1, not 0, for geometry without motion.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[out]motionStepCountNumber of motion steps motionStepCount >= 1

Return values

Relevant return values:

History

rtGeometryTrianglesGetMotionSteps was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetMotionSteps rtGeometryTrianglesGetMotionBorderMode rtGeometryTrianglesGetMotionRange

RTresult RTAPI rtGeometryTrianglesGetPreTransformMatrix ( RTgeometrytriangles  geometrytriangles,
int  transpose,
float *  matrix 
)

Gets a pre-transform matrix.

Description

rtGeometryTrianglesGetPreTransformMatrix returns a previously set 3x4 matrix or the 'identity' matrix (with ones in the main diagonal of the 3x3 submatrix) if no matrix is set.

Parameters
[in]geometrytrianglesGeometry node to query from the number of primitives
[in]transposeSet to true if the output matrix is expected to be column-major rather than row-major
[out]matrixThe 3x4 matrix that is used to transform the vertices

Return values

Relevant return values:

History

rtGeometryTrianglesGetPreTransformMatrix was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetPreTransformMatrix

RTresult RTAPI rtGeometryTrianglesGetPrimitiveCount ( RTgeometrytriangles  geometrytriangles,
unsigned int *  triangleCount 
)

Returns the number of triangles.

Description

rtGeometryTrianglesGetPrimitiveCount returns the number of set triangles for geometrytriangles. The number of primitives can be set with rtGeometryTrianglesSetPrimitiveCount.

Parameters
[in]geometrytrianglesGeometryTriangles node to query from the number of primitives
[out]triangleCountNumber of triangles

Return values

Relevant return values:

History

rtGeometryTrianglesGetPrimitiveCount was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetPrimitiveCount rtGeometryGetPrimitiveCount

RTresult RTAPI rtGeometryTrianglesGetPrimitiveIndexOffset ( RTgeometrytriangles  geometrytriangles,
unsigned int *  indexOffset 
)

Returns the current primitive index offset.

Description

rtGeometryTrianglesGetPrimitiveIndexOffset returns for geometrytriangles the primitive index offset. The primitive index offset can be set with rtGeometryTrianglesSetPrimitiveIndexOffset.

Parameters
[in]geometrytrianglesGeometryTriangles node to query for the primitive index offset
[out]indexOffsetPrimitive index offset

Return values

Relevant return values:

History

rtGeometryTrianglesGetPrimitiveIndexOffset was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetPrimitiveIndexOffset

RTresult RTAPI rtGeometryTrianglesGetVariable ( RTgeometrytriangles  geometrytriangles,
unsigned int  index,
RTvariable v 
)

Get a variable attached to a GeometryTriangles object at a specified index.

Description

rtGeometryTrianglesGetVariable returns the variable attached at a given index to the specified GeometryTriangles object.

Parameters
[in]geometrytrianglesA geometry node
[in]indexThe index of the variable
[out]vA pointer to a variable handle

Return values

Relevant return values:

History

rtGeometryTrianglesGetVariable was introduced in OptiX 6.0.

See also rtGeometryTrianglesDeclareVariable, rtGeometryTrianglesGetVariableCount, rtGeometryTrianglesQueryVariable, rtGeometryTrianglesRemoveVariable

RTresult RTAPI rtGeometryTrianglesGetVariableCount ( RTgeometrytriangles  geometrytriangles,
unsigned int *  count 
)

Get the number of variables attached to a GeometryTriangles object.

Description

rtGeometryTrianglesGetVariableCount returns a count of the number of variables attached to a geometrytriangles object.

Parameters
[in]geometrytrianglesA geometrytriangles node
[out]vA pointer to an unsigned int

Return values

Relevant return values:

History

rtGeometryTrianglesGetVariableCount was introduced in OptiX 6.0.

See also rtGeometryTrianglesDeclareVariable, rtGeometryTrianglesGetVariable, rtGeometryTrianglesQueryVariable, rtGeometryTrianglesRemoveVariable

RTresult RTAPI rtGeometryTrianglesQueryVariable ( RTgeometrytriangles  geometrytriangles,
const char *  name,
RTvariable v 
)

Queries a variable attached to a GeometryTriangles object.

Description

rtGeometryTrianglesQueryVariable gets a variable with a given name from a geometrytriangles object.

Parameters
[in]geometrytrianglesA geometrytriangles object
[in]nameThee name of the variable
[out]vA pointer to a handle to the variable

Return values

Relevant return values:

History

rtGeometryTrianglesQueryVariable was introduced in OptiX 6.0.

See also rtGeometryTrianglesGetVariable, rtGeometryTrianglesGetVariableCount, rtGeometryTrianglesQueryVariable, rtGeometryTrianglesRemoveVariable

RTresult RTAPI rtGeometryTrianglesRemoveVariable ( RTgeometrytriangles  geometrytriangles,
RTvariable  v 
)

Removes a variable from GeometryTriangles object.

Description

rtGeometryTrianglesRemoveVariable removes a variable from a geometrytriangles object.

Parameters
[in]geometrytrianglesA geometrytriangles object
[in]vA pointer to a handle to the variable

Return values

Relevant return values:

History

rtGeometryTrianglesRemoveVariable was introduced in OptiX 6.0.

See also rtGeometryTrianglesDeclareVariable, rtGeometryTrianglesGetVariable, rtGeometryTrianglesGetVariableCount, rtGeometryTrianglesQueryVariable

RTresult RTAPI rtGeometryTrianglesSetAttributeProgram ( RTgeometrytriangles  geometrytriangles,
RTprogram  program 
)

Sets the attribute program on a GeometryTriangles object.

Description

rtGeometryTrianglesSetAttributeProgram sets for geometrytriangles the program that performs attribute computation. RTprograms can be either generated with rtProgramCreateFromPTXFile or rtProgramCreateFromPTXString. An attribute program is optional. If no attribute program is specified, a default attribute program will be provided. Attributes are computed after intersection and before any hit or closest hit programs that require those attributes. No assumptions about the precise invocation time should be made.

The default attribute program will provide the following attributes: float2 barycentrics; unsigned int instanceid;

Names are case sensitive and types must match. To use the attributes, declare the following rtDeclareVariable( float2, barycentrics, attribute barycentrics, ); rtDeclareVariable( unsigned int, instanceid, attribute instanceid, );

If you provide an attribute program, the following device side functions will be available. float2 rtGetTriangleBarycentrics(); unsigned int rtGetInstanceId();

These device functions are only available in attribute programs.

Parameters
[in]geometrytrianglesThe geometrytriangles node for which to set the attribute program
[in]programA handle to the attribute program

Return values

Relevant return values:

History

rtGeometryTrianglesSetAttributeProgram was introduced in OptiX 6.0.

See also rtGeometryTrianglesGetAttributeProgram, rtProgramCreateFromPTXFile, rtProgramCreateFromPTXString, rtGetTriangleBarycentrics, rtGetInstanceId

RTresult RTAPI rtGeometryTrianglesSetBuildFlags ( RTgeometrytriangles  geometrytriangles,
RTgeometrybuildflags  buildFlags 
)

Sets flags that influence the behavior of traversal.

Description rtGeometryTrianglesSetBuildFlags can be used to set object-specific flags that affect the acceleration-structure-build behavior. If parameter buildFlags contains the RT_GEOMETRY_BUILD_FLAG_RELEASE_BUFFERS flag, all buffers (including the vertex, index, and materialIndex buffer) holding information that is evaluated at acceleration-structure-build time will be released after the build. OptiX does not take ownership over the buffers, but simply frees the corresponding device memory. Sharing buffers with other GeometryTriangles nodes is possible if all of them are built within one OptiX launch. Note that it is the users responsibility that the buffers hold data for the next acceleration structure build if the acceleration structure is marked dirty. E.g., if the flag is set, an OptiX launch will cause the acceleration structure build and release the memory afterwards. If the acceleration structure is marked dirty before the next launch (e.g., due to refitting), the user needs to map the buffers before the launch to fill them with data. Further, there are certain configurations with motion when the buffers cannot be released in which case the flag is ignored and the data is not freed. The buffers can only be released if all GeometryTriangles belonging to a GeometryGroup have the same number of motion steps and equal motion begin / end times.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[in]buildFlagsThe flags to set

Return values

Relevant return values:

History

rtGeometryTrianglesSetBuildFlags was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetBuildFlags

RTresult RTAPI rtGeometryTrianglesSetFlagsPerMaterial ( RTgeometrytriangles  geometrytriangles,
unsigned int  materialIndex,
RTgeometryflags  flags 
)

Sets geometry-specific flags that influence the behavior of traversal.

Description rtGeometryTrianglesSetFlagsPerMaterial can be used to set geometry-specific flags that will eventually change the behavior of traversal when intersecting the geometry. Note that the flags are evaluated at acceleration-structure-build time. An acceleration must be marked dirty for changes to the flags to take effect. Setting the flags RT_GEOMETRY_FLAG_NO_SPLITTING and/or RT_GEOMETRY_FLAG_DISABLE_ANYHIT should be dependent on the material that is used for the intersection. Therefore, the flags are set per material slot (with the actual material binding begin set at the GeomteryInstance). If the geometry is instanced and different instances apply different materials to the geometry, the per-material geometry-specific flags need to apply to the materials of all instances. Example with two instances with each having two materials, node graph: G / \ / \ T0 T1 | | GG0-A-GG1 | | M0-GI0 GI1-M2 / \ / \ M1 GT M3 with: G-Group, GG-GeometryGroup, T-Transform, A-Acceleration, GI-GeometryInstance, M-Material, GT-GeometryTriangles RT_GEOMETRY_FLAG_NO_SPLITTING needs to be set for material index 0, if M0 or M2 require it. RT_GEOMETRY_FLAG_DISABLE_ANYHIT should be set for material index 0, if M0 and M2 allow it. RT_GEOMETRY_FLAG_NO_SPLITTING needs to be set for material index 1, if M1 or M3 require it. RT_GEOMETRY_FLAG_DISABLE_ANYHIT should be set for material index 1, if M1 and M3 allow it.

Setting RT_GEOMETRY_FLAG_NO_SPLITTING prevents splitting the primitive during the bvh build. Splitting is done to increase performance, but as a side-effect may result in multiple executions of the any hit program for a single intersection. To avoid further side effects (e.g., multiple accumulations of a value) that may result of a multiple execution, RT_GEOMETRY_FLAG_NO_SPLITTING needs to be set. RT_GEOMETRY_FLAG_DISABLE_ANYHIT is an optimization due to which the execution of the any hit program is skipped. If possible, the flag should be set. Note that even if no any hit program is set on a material, this flag needs to be set to skip the any hit program. This requirement is because the information whether or not to skip the any hit program needs to be available at bvh build time (while materials can change afterwards without a bvh rebuild). Note that the final decision whether or not to execute the any hit program at run time also depends on the flags set on the ray as well as the geometry group that this geometry is part of.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[in]materialIndexThe material index for which to set the flags
[in]flagsThe flags to set.

Return values

Relevant return values:

History

rtGeometryTrianglesSetFlagsPerMaterial was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetMaterialCount rtGeometryTrianglesSetMaterialIndices rtGeometryTrianglesSetBuildFlags

RTresult RTAPI rtGeometryTrianglesSetMaterialCount ( RTgeometrytriangles  geometrytriangles,
unsigned int  numMaterials 
)

Sets the number of materials used for the GeometryTriangles.

Description rtGeometryTrianglesSetMaterialCount sets the number of materials that are used with geometrytriangles. As default, there is one material slot. This number must be equal to the number of materials that is set at the GeometryInstance where geometrytriangles is attached to. Multi-material support for GeometryTriangles is limited to a fixed partition of the geometry into sets of triangles. Each triangle set maps to one material slot (within range [0;numMaterials]). The mapping is set via rtGeometryTrianglesSetMaterialIndices. The actual materials are set at the GeometryInstance. The geometry can be instanced when attached to multiple GeometryInstances. In that case, the materials attached to each GeometryInstance can differ (effectively causing different materials per instance of the geometry). numMaterials must be >=1 and <= 2^16.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[in]numMaterialsNumber of materials used with this geometry

Return values

Relevant return values:

History

rtGeometryTrianglesSetMaterialCount was introduced in OptiX 6.0.

See also rtGeometryTrianglesGetMaterialCount rtGeometryTrianglesSetMaterialIndices rtGeometryTrianglesSetFlagsPerMaterial

RTresult RTAPI rtGeometryTrianglesSetMaterialIndices ( RTgeometrytriangles  geometrytriangles,
RTbuffer  materialIndexBuffer,
RTsize  materialIndexBufferByteOffset,
RTsize  materialIndexByteStride,
RTformat  materialIndexFormat 
)

Sets the index buffer of indexed triangles.

Description

rtGeometryTrianglesSetMaterialIndices set the material slot per triangle of geometrytriangles. Hence, buffer materialIndexBuffer must hold triangleCount entries. Every material index must be in range see 0; numMaterials-1. Parameter materialIndexBufferByteOffset can be used to specify a byte offset to the first index in buffer materialIndexBuffer. Parameter materialIndexByteStride sets the stride in bytes between indices. Parameter materialIndexFormat must be one of the following: RT_FORMAT_UNSIGNED_INT, RT_FORMAT_UNSIGNED_SHORT, RT_FORMAT_UNSIGNED_BYTE. The buffer is only used if the number of materials as set via rtGeometryTrianglesSetMaterialCount is larger than one.

Parameters
[in]geometrytrianglesGeometryTriangles node to query for the primitive index offset
[in]materialIndexBufferBuffer that holds the indices into the vertex buffer of the triangles
[in]materialIndexBufferByteOffsetOffset to first index in buffer indexBuffer
[in]materialIndexByteStrideStride in bytes between triplets of indices
[in]materialIndexFormatFormat of the triplet of indices to index the vertices of a triangle

Return values

Relevant return values:

History

rtGeometryTrianglesSetMaterialIndices was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetMaterialCount rtGeometryTrianglesSetFlagsPerMaterial

RTresult RTAPI rtGeometryTrianglesSetMotionBorderMode ( RTgeometrytriangles  geometrytriangles,
RTmotionbordermode  beginMode,
RTmotionbordermode  endMode 
)

Sets the motion border modes of a GeometryTriangles node.

Description rtGeometryTrianglesSetMotionBorderMode sets the behavior of geometrytriangles outside its motion time range. Options are RT_MOTIONBORDERMODE_CLAMP or RT_MOTIONBORDERMODE_VANISH. See rtTransformSetMotionBorderMode for details.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[in]beginModeMotion border mode at motion range begin
[in]endModeMotion border mode at motion range end

Return values

Relevant return values:

History

rtGeometryTrianglesSetMotionBorderMode was introduced in OptiX 6.0.

See also rtGeometryTrianglesGetMotionBorderMode rtGeometryTrianglesSetMotionRange rtGeometryTrianglesGetMotionSteps

RTresult RTAPI rtGeometryTrianglesSetMotionRange ( RTgeometrytriangles  geometrytriangles,
float  timeBegin,
float  timeEnd 
)

Sets the motion time range for a GeometryTriangles node.

Description Sets the inclusive motion time range [timeBegin, timeEnd] for geometrytriangles, where timeBegin <= timeEnd. The default time range is [0.0, 1.0]. The time range has no effect unless rtGeometryTrianglesSetMotionVertices or rtGeometryTrianglesSetMotionVerticesMultiBuffer with motionStepCount > 1 is called, in which case the time steps uniformly divide the time range.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[out]timeBeginBeginning time value of range
[out]timeEndEnding time value of range

Return values

Relevant return values:

History

rtGeometryTrianglesSetMotionRange was introduced in OptiX 6.0.

See also rtGeometryTrianglesGetMotionRange rtGeometryTrianglesSetMotionBorderMode rtGeometryTrianglesGetMotionSteps

RTresult RTAPI rtGeometryTrianglesSetMotionSteps ( RTgeometrytriangles  geometrytriangles,
unsigned int  motionStepCount 
)

Sets the number of motion steps associated with a GeometryTriangles node.

Description rtGeometryTrianglesSetMotionSteps sets the number of motion steps as specified in motionStepCount associated with geometrytriangles. Note that the default value is 1, not 0, for geometry without motion.

Parameters
[in]geometrytrianglesGeometryTriangles node handle
[in]motionStepCountNumber of motion steps, motionStepCount >= 1

Return values

Relevant return values:

History

rtGeometryTrianglesGetMotionSteps was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetMotionVertices rtGeometryTrianglesSetMotionVerticesMultiBuffer rtGeometryTrianglesGetMotionSteps rtGeometryTrianglesSetMotionBorderMode rtGeometryTrianglesSetMotionRange

RTresult RTAPI rtGeometryTrianglesSetMotionVertices ( RTgeometrytriangles  geometrytriangles,
unsigned int  vertexCount,
RTbuffer  vertexBuffer,
RTsize  vertexBufferByteOffset,
RTsize  vertexByteStride,
RTsize  vertexMotionStepByteStride,
RTformat  positionFormat 
)

Sets the vertex buffer of motion triangles.

Description

rtGeometryTrianglesSetMotionVertices interprets the buffer vertexBuffer as the vertices of triangles of the GeometryTriangles geometrytriangles. The number of triangles for one motion step is set as vertexCount. Similar to it's non-motion counterpart, vertexCount must be 3 times triangleCount if no index buffer is set. The total number of vertices stored in vertexBuffer is vertexCount times motionStepCount (see rtGeometryTrianglesSetMotionSteps). Triangles are linearly interpolated between motion steps. Parameter vertexBufferByteOffset can be used to specify a byte offset to the position of the first vertex of the first motion step in buffer vertexBuffer. Parameter vertexByteStride sets the stride in bytes between vertices within a motion step. Parameter vertexMotionStepByteStride sets the stride in bytes between motion steps for a single vertex. The stride parameters allow for two types of layouts of the motion data: a) serialized: vertexByteStride = sizeof(Vertex), vertexMotionStepByteStride = vertexCount * vertexByteStride b) interleaved: motion_step_byte_stride = sizeof(Vertex), vertexByteStride = sizeof(Vertex) * motion_steps Vertex N at time step i is at: vertexBuffer[N * vertexByteStride + i * vertexMotionStepByteStride + vertexBufferByteOffset] Parameter positionFormat must be one of the following: RT_FORMAT_FLOAT3, RT_FORMAT_HALF3, RT_FORMAT_FLOAT2, RT_FORMAT_HALF2. In case of formats RT_FORMAT_FLOAT2 or RT_FORMAT_HALF2 the third component is assumed to be zero, which can be useful for planar geometry. Calling this function overrides any previous call to anyone of the set(Motion)Vertices functions.

Parameters
[in]geometrytrianglesGeometryTriangles node to query for the primitive index offset
[in]vertexCountNumber of vertices for one motion step
[in]vertexBufferBuffer that holds the vertices of the triangles for all motion steps
[in]vertexBufferByteOffsetOffset in bytes to the first vertex of the first motion step in buffer vertexBuffer
[in]vertexByteStrideStride in bytes between vertices, belonging to the same motion step
[in]vertexMotionStepByteStrideStride in bytes between vertices of the same triangle, but neighboring motion step
[in]positionFormatFormat of the position attribute of a vertex

Return values

Relevant return values:

History

rtGeometryTrianglesSetMotionVertices was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetVertices rtGeometryTrianglesSetMotionVerticesMultiBuffer

RTresult RTAPI rtGeometryTrianglesSetMotionVerticesMultiBuffer ( RTgeometrytriangles  geometrytriangles,
unsigned int  vertexCount,
RTbuffer vertexBuffers,
unsigned int  vertexBufferCount,
RTsize  vertexBufferByteOffset,
RTsize  vertexByteStride,
RTformat  positionFormat 
)

Sets the vertex buffer of motion triangles.

Description

rtGeometryTrianglesSetMotionVerticesMultiBuffer can be used instead of rtGeometryTrianglesSetMotionVertices if the vertices for the different motion steps are stored in separate buffers. Parameter vertexBuffers must point to an array of buffers of minimal size motionStepCount (see rtGeometryTrianglesSetMotionSteps). All buffers must, however, share the same byte offset as well as vertex stride and position format. Calling this function overrides any previous call to any of the set(Motion)Vertices functions.

Parameters
[in]geometrytrianglesGeometryTriangles node to query for the primitive index offset
[in]vertexCountNumber of vertices for one motion step
[in]vertexBuffersBuffers that hold the vertices of the triangles per motion step
[in]vertexBufferCountNumber of buffers passed, must match the number of motion steps before a launch call
[in]vertexBufferByteOffsetOffset in bytes to the first vertex in every buffer vertexBuffers
[in]vertexByteStrideStride in bytes between vertices, belonging to the same motion step
[in]positionFormatFormat of the position attribute of a vertex

Return values

Relevant return values:

History

rtGeometryTrianglesSetMotionVertices was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetVertices rtGeometryTrianglesSetMotionVertices

RTresult RTAPI rtGeometryTrianglesSetPreTransformMatrix ( RTgeometrytriangles  geometrytriangles,
int  transpose,
const float *  matrix 
)

Sets a pre-transform matrix.

Description

rtGeometryTrianglesSetPreTransformMatrix can be used to bake a transformation for a mesh. Vertices of triangles are multiplied by the user-specified 3x4 matrix before the acceleration build. Note that the input triangle data stays untouched (set via rtGeometryTrianglesSetVertices). Triangle intersection uses transformed triangles. The 3x4 matrix is expected to be in a row-major data layout, use the transpose option if matrix is in a column-major data layout. Use rtGeometryTrianglesSetPreTransformMatrix(geometrytriangles, false, 0); to unset a previously set matrix.

Parameters
[in]geometrytrianglesGeometry node to query from the number of primitives
[in]transposeIf the input matrix is column-major and needs to be transposed before usage
[in]matrixThe 3x4 matrix that is used to transform the vertices

Return values

Relevant return values:

History

rtGeometryTrianglesSetPreTransformMatrix was introduced in OptiX 6.0.

See also rtGeometryTrianglesGetPreTransformMatrix

RTresult RTAPI rtGeometryTrianglesSetPrimitiveCount ( RTgeometrytriangles  geometrytriangles,
unsigned int  triangleCount 
)

Sets the number of triangles.

Description

rtGeometryTrianglesSetPrimitiveCount sets the number of triangles triangleCount in geometrytriangles. A triangle geometry is either a triangle soup for which every three vertices stored in the vertex buffer form a triangle, or indexed triangles are used for which three indices reference different vertices. In the latter case, an index buffer must be set (rtGeometryTrianglesSetTriangleIndices). The vertices of the triangles are specified via one of the SetVertices functions.

Parameters
[in]geometrytrianglesGeometryTriangles node for which to set the number of triangles
[in]triangleCountNumber of triangles

Return values

Relevant return values:

History

rtGeometryTrianglesSetPrimitiveCount was introduced in OptiX 6.0.

See also rtGeometryTrianglesGetPrimitiveCount rtGeometrySetPrimitiveCount

RTresult RTAPI rtGeometryTrianglesSetPrimitiveIndexOffset ( RTgeometrytriangles  geometrytriangles,
unsigned int  indexOffset 
)

Sets the primitive index offset.

Description

rtGeometryTrianglesSetPrimitiveIndexOffset sets the primitive index offset indexOffset in geometrytriangles. With an offset of zero, a GeometryTriangles with N triangles has a primitive index range of [0,N-1]. The index offset is used to allow GeometryTriangles objects to have primitive index ranges starting at non-zero positions (i.e., a GeometryTriangles with N triangles and an index offset of M has a primitive index range of [M,M+N-1]). Note that this offset only affects the primitive index that is reported in case of an intersection and does not affect the input data that is specified via rtGeometryTrianglesSetVertices or rtGeometryTrianglesSetTriangleIndices. This feature enables the packing of multiple Geometries or GeometryTriangles into a single buffer. While the same effect could be reached via a user variable, it is recommended to specify the offset via rtGeometryTrianglesSetPrimitiveIndexOffset.

Parameters
[in]geometrytrianglesThe GeometryTriangles node for which to set the primitive index offset
[in]indexOffsetThe primitive index offset

Return values

Relevant return values:

History

rtGeometryTrianglesSetPrimitiveIndexOffset was introduced in OptiX 6.0.

See also rtGeometrySetPrimitiveIndexOffset rtGeometryTrianglesGetPrimitiveIndexOffset

RTresult RTAPI rtGeometryTrianglesSetTriangleIndices ( RTgeometrytriangles  geometrytriangles,
RTbuffer  indexBuffer,
RTsize  indexBufferByteOffset,
RTsize  triIndicesByteStride,
RTformat  triIndicesFormat 
)

Sets the index buffer of indexed triangles.

Description

rtGeometryTrianglesSetTriangleIndices is used to set the index buffer for indexed triangles. Triplets of indices from buffer indexBuffer index vertices to form triangles. If the buffer is set, it is assumed that the geometry is given as indexed triangles. If the index buffer is not set, it is assumed that the geometry is given as a triangle soup. A previously set index buffer can be unset by passing NULL as indexBuffer parameter, e.g., rtGeometryTrianglesSetTriangleIndices( geometrytriangles, NULL, 0, 0, RT_FORMAT_UNSIGNED_INT3); Buffer indexBuffer is expected to hold 3 times triangleCount indices (see rtGeometryTrianglesSetPrimitiveCount). Parameter indexBufferByteOffset can be used to specify a byte offset to the first index in buffer indexBuffer. Parameter triIndicesByteStride sets the stride in bytes between triplets of indices. There mustn't be any spacing between indices within a triplet, spacing is only supported between triplets. Parameter triIndicesFormat must be one of the following: RT_FORMAT_UNSIGNED_INT3, RT_FORMAT_UNSIGNED_SHORT3.

Parameters
[in]geometrytrianglesGeometryTriangles node to query for the primitive index offset
[in]indexBufferBuffer that holds the indices into the vertex buffer of the triangles
[in]indexBufferByteOffsetOffset in bytes to the first index in buffer indexBuffer
[in]triIndicesByteStrideStride in bytes between triplets of indices
[in]triIndicesFormatFormat of the triplet of indices to index the vertices of a triangle

Return values

Relevant return values:

History

rtGeometryTrianglesSetTriangleIndices was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetVertices

RTresult RTAPI rtGeometryTrianglesSetVertices ( RTgeometrytriangles  geometrytriangles,
unsigned int  vertexCount,
RTbuffer  vertexBuffer,
RTsize  vertexBufferByteOffset,
RTsize  vertexByteStride,
RTformat  positionFormat 
)

Sets the vertex buffer of a triangle soup.

Description

rtGeometryTrianglesSetVertices interprets the buffer vertexBuffer as the vertices of triangles of the GeometryTriangles geometrytriangles. The number of vertices is set as vertexCount. If an index buffer is set, it is assumed that the geometry is given as indexed triangles. If the index buffer is not set, it is assumed that the geometry is given as a triangle soup and vertexCount must be 3 times triangleCount (see rtGeometryTrianglesSetPrimitiveCount). Buffer vertexBuffer is expected to hold vertexCount vertices. Parameter vertexBufferByteOffset can be used to specify a byte offset to the position of the first vertex in buffer vertexBuffer. Parameter vertexByteStride sets the stride in bytes between vertices. Parameter positionFormat must be one of the following: RT_FORMAT_FLOAT3, RT_FORMAT_HALF3, RT_FORMAT_FLOAT2, RT_FORMAT_HALF2. In case of formats RT_FORMAT_FLOAT2 or RT_FORMAT_HALF2 the third component is assumed to be zero, which can be useful for planar geometry. Calling this function overrides any previous call to anyone of the set(Motion)Vertices functions.

Parameters
[in]geometrytrianglesGeometryTriangles node to query for the primitive index offset
[in]vertexCountNumber of vertices of the geometry
[in]vertexBufferBuffer that holds the vertices of the triangles
[in]vertexByteStrideStride in bytes between vertices
[in]vertexBufferByteOffsetOffset in bytes to the first vertex in buffer vertexBuffer
[in]positionFormatFormat of the position attribute of a vertex

Return values

Relevant return values:

History

rtGeometryTrianglesSetVertices was introduced in OptiX 6.0.

See also rtGeometryTrianglesSetTriangleIndices rtGeometryTrianglesSetMotionVertices

RTresult RTAPI rtGeometryTrianglesValidate ( RTgeometrytriangles  geometrytriangles)

Validates the GeometryTriangles nodes integrity.

Description

rtGeometryTrianglesValidate checks geometrytriangles for completeness. If geometrytriangles or any of the objects attached to geometrytriangles are not valid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]geometrytrianglesThe GeometryTriangles node to be validated

Return values

Relevant return values:

History

rtGeometryTrianglesValidate was introduced in OptiX 6.0.

See also rtContextValidate

RTresult RTAPI rtGeometryValidate ( RTgeometry  geometry)

Validates the geometry nodes integrity.

Description

rtGeometryValidate checks geometry for completeness. If geometry or any of the objects attached to geometry are not valid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]geometryThe geometry node to be validated

Return values

Relevant return values:

History

rtGeometryValidate was introduced in OptiX 1.0.

See also rtContextValidate

RTresult RTAPI rtGetVersion ( unsigned int *  version)

Returns the current OptiX version.

Description

rtGetVersion returns in version a numerically comparable version number of the current OptiX library.

The encoding for the version number prior to OptiX 4.0.0 is major*1000 + minor*10 + micro. For versions 4.0.0 and higher, the encoding is major*10000 + minor*100 + micro. For example, for version 3.5.1 this function would return 3051, and for version 4.5.1 it would return 40501.

Parameters
[out]versionOptiX version number

Return values

Relevant return values:

History

rtGetVersion was introduced in OptiX 1.0.

See also rtDeviceGetDeviceCount

RTresult RTAPI rtGlobalGetAttribute ( RTglobalattribute  attrib,
RTsize  size,
void *  p 
)

Returns a global attribute.

Description

rtGlobalGetAttribute returns in p the value of the global attribute specified by attrib.

Each attribute can have a different size. The sizes are given in the following list:

RT_GLOBAL_ATTRIBUTE_ENABLE_RTX is an experimental setting which sets the execution strategy used by Optix for the next context to be created.

RT_GLOBAL_ATTRIBUTE_DISPLAY_DRIVER_VERSION_MAJOR is an attribute to query the major version of the display driver found on the system. It's the first number in the driver version displayed as xxx.yy.

RT_GLOBAL_ATTRIBUTE_DISPLAY_DRIVER_VERSION_MINOR is an attribute to query the minor version of the display driver found on the system. It's the second number in the driver version displayed as xxx.yy.

Parameters
[in]attribAttribute to query
[in]sizeSize of the attribute being queried. Parameter p must have at least this much memory allocated
[out]pReturn pointer where the value of the attribute will be copied into. This must point to at least size bytes of memory

Return values

Relevant return values:

History

rtGlobalGetAttribute was introduced in OptiX 5.1.

See also rtGlobalSetAttribute,

RTresult RTAPI rtGlobalSetAttribute ( RTglobalattribute  attrib,
RTsize  size,
const void *  p 
)

Set a global attribute.

Description

rtGlobalSetAttribute sets p as the value of the global attribute specified by attrib.

Each attribute can have a different size. The sizes are given in the following list:

RT_GLOBAL_ATTRIBUTE_ENABLE_RTX is an experimental attribute which sets the execution strategy used by Optix for the next context to be created. This attribute may be deprecated in a future release. Possible values: 0 (legacy default), 1 (compile and link programs separately).

Parameters
[in]attribAttribute to set
[in]sizeSize of the attribute being set
[in]pPointer to where the value of the attribute will be copied from. This must point to at least size bytes of memory

Return values

Relevant return values:

History

rtGlobalSetAttribute was introduced in OptiX 5.1.

See also rtGlobalGetAttribute

RTresult RTAPI rtGroupCreate ( RTcontext  context,
RTgroup group 
)

Creates a new group.

Description

rtGroupCreate creates a new group within a context. context specifies the target context, and should be a value returned by rtContextCreate. Sets *group to the handle of a newly created group within context. Returns RT_ERROR_INVALID_VALUE if group is NULL.

Parameters
[in]contextSpecifies a context within which to create a new group
[out]groupReturns a newly created group

Return values

Relevant return values:

History

rtGroupCreate was introduced in OptiX 1.0.

See also rtGroupDestroy, rtContextCreate

RTresult RTAPI rtGroupDestroy ( RTgroup  group)

Destroys a group node.

Description

rtGroupDestroy removes group from its context and deletes it. group should be a value returned by rtGroupCreate. No child graph nodes are destroyed. After the call, group is no longer a valid handle.

Parameters
[in]groupHandle of the group node to destroy

Return values

Relevant return values:

History

rtGroupDestroy was introduced in OptiX 1.0.

See also rtGroupCreate

RTresult RTAPI rtGroupGetAcceleration ( RTgroup  group,
RTacceleration acceleration 
)

Returns the acceleration structure attached to a group.

Description

rtGroupGetAcceleration returns the acceleration structure attached to a group using rtGroupSetAcceleration. If no acceleration structure has previously been set, *acceleration is set to NULL.

Parameters
[in]groupThe group handle
[out]accelerationThe returned acceleration structure object

Return values

Relevant return values:

History

rtGroupGetAcceleration was introduced in OptiX 1.0.

See also rtGroupSetAcceleration, rtAccelerationCreate

RTresult RTAPI rtGroupGetChild ( RTgroup  group,
unsigned int  index,
RTobject child 
)

Returns a child node of a group.

Description

rtGroupGetChild returns the child object at slot index of the parent group. If no child has been assigned to the given slot, *child is set to NULL. Returns RT_ERROR_INVALID_VALUE if given an invalid child index or NULL pointer.

Parameters
[in]groupThe parent group handle
[in]indexThe index of the child slot to query
[out]childThe returned child object

Return values

Relevant return values:

History

rtGroupGetChild was introduced in OptiX 1.0.

See also rtGroupSetChild, rtGroupSetChildCount, rtGroupGetChildCount, rtGroupGetChildType

RTresult RTAPI rtGroupGetChildCount ( RTgroup  group,
unsigned int *  count 
)

Returns the number of child slots for a group.

Description

rtGroupGetChildCount returns the number of child slots allocated using rtGroupSetChildCount. This includes empty slots which may not yet have actual children assigned by rtGroupSetChild. Returns RT_ERROR_INVALID_VALUE if given a NULL pointer.

Parameters
[in]groupThe parent group handle
[out]countReturned number of child slots

Return values

Relevant return values:

History

rtGroupGetChildCount was introduced in OptiX 1.0.

See also rtGroupSetChild, rtGroupGetChild, rtGroupSetChildCount, rtGroupGetChildType

RTresult RTAPI rtGroupGetChildType ( RTgroup  group,
unsigned int  index,
RTobjecttype type 
)

Get the type of a group child.

Description

rtGroupGetChildType returns the type of the group child at slot index. If no child is associated with the given index, *type is set to RT_OBJECTTYPE_UNKNOWN and RT_ERROR_INVALID_VALUE is returned. Returns RT_ERROR_INVALID_VALUE if given a NULL pointer.

Parameters
[in]groupThe parent group handle
[in]indexThe index of the child slot to query
[out]typeThe returned child type

Return values

Relevant return values:

History

rtGroupGetChildType was introduced in OptiX 1.0.

See also rtGroupSetChild, rtGroupGetChild, rtGroupSetChildCount, rtGroupGetChildCount

RTresult RTAPI rtGroupGetContext ( RTgroup  group,
RTcontext context 
)

Returns the context associated with a group.

Description

rtGroupGetContext queries a group for its associated context. group specifies the group to query, and must be a value returned by rtGroupCreate. Sets *context to the context associated with group.

Parameters
[in]groupSpecifies the group to query
[out]contextReturns the context associated with the group

Return values

Relevant return values:

History

rtGroupGetContext was introduced in OptiX 1.0.

See also rtContextCreate, rtGroupCreate

RTresult RTAPI rtGroupGetVisibilityMask ( RTgroup  group,
RTvisibilitymask *  mask 
)

Retrieves the visibility mask of a group.

Description See rtGroupSetVisibilityMask for details.

Parameters
[in]groupThe group handle
[out]maskA set of bits for which rays will intersect the group

Return values

Relevant return values:

History

rtGroupGetVisibilityMask was introduced in OptiX 6.0.

See also rtGeometryGroupGetVisibilityMask, rtGroupSetVisibilityMask, rtTrace

RTresult RTAPI rtGroupSetAcceleration ( RTgroup  group,
RTacceleration  acceleration 
)

Set the acceleration structure for a group.

Description

rtGroupSetAcceleration attaches an acceleration structure to a group. The acceleration structure must have been previously created using rtAccelerationCreate. Every group is required to have an acceleration structure assigned in order to pass validation. The acceleration structure will be built over the children of the group. For example, if an acceleration structure is attached to a group that has a selector, a geometry group, and a transform child, the acceleration structure will be built over the bounding volumes of these three objects.

Note that it is legal to attach a single RTacceleration object to multiple groups, as long as the underlying bounds of the children are the same. For example, if another group has three children which are known to have the same bounding volumes as the ones in the example above, the two groups can share an acceleration structure, thus saving build time. This is true even if the details of the children, such as the actual type of a node or its geometry content, differ from the first set of group children. All that is required is for a child node at a given index to have the same bounds as the other group's child node at the same index.

Sharing an acceleration structure this way corresponds to attaching an acceleration structure to multiple geometry groups at lower graph levels using rtGeometryGroupSetAcceleration.

Parameters
[in]groupThe group handle
[in]accelerationThe acceleration structure to attach to the group

Return values

Relevant return values:

History

rtGroupSetAcceleration was introduced in OptiX 1.0.

See also rtGroupGetAcceleration, rtAccelerationCreate, rtGeometryGroupSetAcceleration

RTresult RTAPI rtGroupSetChild ( RTgroup  group,
unsigned int  index,
RTobject  child 
)

Attaches a child node to a group.

Description

Attaches a new child node child to the parent node group. index specifies the number of the slot where the child node gets attached. A sufficient number of slots must be allocated using rtGroupSetChildCount. Legal child node types are RTgroup, RTselector, RTgeometrygroup, and RTtransform.

Parameters
[in]groupThe parent group handle
[in]indexThe index in the parent's child slot array
[in]childThe child node to be attached. Can be of type {RTgroup, RTselector, RTgeometrygroup, RTtransform}

Return values

Relevant return values:

History

rtGroupSetChild was introduced in OptiX 1.0.

See also rtGroupSetChildCount, rtGroupGetChildCount, rtGroupGetChild, rtGroupGetChildType

RTresult RTAPI rtGroupSetChildCount ( RTgroup  group,
unsigned int  count 
)

Sets the number of child nodes to be attached to the group.

Description

rtGroupSetChildCount specifies the number of child slots in this group. Potentially existing links to children at indices greater than count-1 are removed. If the call increases the number of slots, the newly created slots are empty and need to be filled using rtGroupSetChild before validation.

Parameters
[in]groupThe parent group handle
[in]countNumber of child slots to allocate for the group

Return values

Relevant return values:

History

rtGroupSetChildCount was introduced in OptiX 1.0.

See also rtGroupGetChild, rtGroupGetChildCount, rtGroupGetChildType, rtGroupSetChild

RTresult RTAPI rtGroupSetVisibilityMask ( RTgroup  group,
RTvisibilitymask  mask 
)

Sets the visibility mask for a group.

Description Geometry is intersected by rays if the ray's RTvisibilitymask shares at least one bit with the geometry's mask. This mechanism allows for a number of user-defined visibility groups that can be excluded from certain types of rays as needed.

Note that the

Precondition
mask is currently limited to 8 bits.
Parameters
[in]groupThe group handle
[in]maskA set of bits for which rays will intersect the group

Return values

Relevant return values:

History

rtGroupSetVisibilityMask was introduced in OptiX 6.0.

See also rtGeometryGroupSetVisibilityMask, rtGroupGetVisibilityMask, rtTrace

RTresult RTAPI rtGroupValidate ( RTgroup  group)

Verifies the state of the group.

Description

rtGroupValidate checks group for completeness. If group or any of the objects attached to group are not valid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]groupSpecifies the group to be validated

Return values

Relevant return values:

History

rtGroupValidate was introduced in OptiX 1.0.

See also rtGroupCreate

RTresult RTAPI rtMaterialCreate ( RTcontext  context,
RTmaterial material 
)

Creates a new material.

Description

rtMaterialCreate creates a new material within a context. context specifies the target context, as returned by rtContextCreate. Sets *material to the handle of a newly created material within context. Returns RT_ERROR_INVALID_VALUE if material is NULL.

Parameters
[in]contextSpecifies a context within which to create a new material
[out]materialReturns a newly created material

Return values

Relevant return values:

History

rtMaterialCreate was introduced in OptiX 1.0.

See also rtMaterialDestroy, rtContextCreate

RTresult RTAPI rtMaterialDeclareVariable ( RTmaterial  material,
const char *  name,
RTvariable v 
)

Declares a new named variable to be associated with a material.

Description

rtMaterialDeclareVariable declares a new variable to be associated with a material. material specifies the target material, and should be a value returned by rtMaterialCreate. name specifies the name of the variable, and should be a NULL-terminated string. If there is currently no variable associated with material named name, and v is not NULL, a new variable named name will be created and associated with material and *v will be set to the handle of the newly-created variable. Otherwise, this call has no effect and returns either RT_ERROR_INVALID_VALUE if either name or v is NULL or RT_ERROR_VARIABLE_REDECLARED if name is the name of an existing variable associated with the material.

Parameters
[in]materialSpecifies the material to modify
[in]nameSpecifies the name of the variable
[out]vReturns a handle to a newly declared variable

Return values

Relevant return values:

History

rtMaterialDeclareVariable was introduced in OptiX 1.0.

See also rtMaterialGetVariable, rtMaterialQueryVariable, rtMaterialCreate

RTresult RTAPI rtMaterialDestroy ( RTmaterial  material)

Destroys a material object.

Description

rtMaterialDestroy removes material from its context and deletes it. material should be a value returned by rtMaterialCreate. Associated variables declared via rtMaterialDeclareVariable are destroyed, but no child graph nodes are destroyed. After the call, material is no longer a valid handle.

Parameters
[in]materialHandle of the material node to destroy

Return values

Relevant return values:

History

rtMaterialDestroy was introduced in OptiX 1.0.

See also rtMaterialCreate

RTresult RTAPI rtMaterialGetAnyHitProgram ( RTmaterial  material,
unsigned int  rayTypeIndex,
RTprogram program 
)

Returns the any hit program associated with a (material, ray type) tuple.

Description

rtMaterialGetAnyHitProgram queries the any hit program associated with a (material, ray type) tuple. material specifies the material of interest and should be a value returned by rtMaterialCreate. rayTypeIndex specifies the target ray type and should be a value less than the value returned by rtContextGetRayTypeCount. if all parameters are valid, *program sets to the handle of the any hit program associated with the tuple (material, rayTypeIndex). Otherwise, the call has no effect and returns RT_ERROR_INVALID_VALUE.

Parameters
[in]materialSpecifies the material of the (material, ray type) tuple to query
[in]rayTypeIndexSpecifies the type of ray of the (material, ray type) tuple to query
[out]programReturns the any hit program associated with the (material, ray type) tuple

Return values

Relevant return values:

History

rtMaterialGetAnyHitProgram was introduced in OptiX 1.0.

See also rtMaterialSetAnyHitProgram, rtMaterialCreate, rtContextGetRayTypeCount

RTresult RTAPI rtMaterialGetClosestHitProgram ( RTmaterial  material,
unsigned int  rayTypeIndex,
RTprogram program 
)

Returns the closest hit program associated with a (material, ray type) tuple.

Description

rtMaterialGetClosestHitProgram queries the closest hit program associated with a (material, ray type) tuple. material specifies the material of interest and should be a value returned by rtMaterialCreate. rayTypeIndex specifies the target ray type and should be a value less than the value returned by rtContextGetRayTypeCount. If all parameters are valid, *program sets to the handle of the any hit program associated with the tuple (material, rayTypeIndex). Otherwise, the call has no effect and returns RT_ERROR_INVALID_VALUE.

Parameters
[in]materialSpecifies the material of the (material, ray type) tuple to query
[in]rayTypeIndexSpecifies the type of ray of the (material, ray type) tuple to query
[out]programReturns the closest hit program associated with the (material, ray type) tuple

Return values

Relevant return values:

History

rtMaterialGetClosestHitProgram was introduced in OptiX 1.0.

See also rtMaterialSetClosestHitProgram, rtMaterialCreate, rtContextGetRayTypeCount

RTresult RTAPI rtMaterialGetContext ( RTmaterial  material,
RTcontext context 
)

Returns the context associated with a material.

Description

rtMaterialGetContext queries a material for its associated context. material specifies the material to query, and should be a value returned by rtMaterialCreate. If both parameters are valid, *context sets to the context associated with material. Otherwise, the call has no effect and returns RT_ERROR_INVALID_VALUE.

Parameters
[in]materialSpecifies the material to query
[out]contextReturns the context associated with the material

Return values

Relevant return values:

History

rtMaterialGetContext was introduced in OptiX 1.0.

See also rtMaterialCreate

RTresult RTAPI rtMaterialGetVariable ( RTmaterial  material,
unsigned int  index,
RTvariable v 
)

Returns a handle to an indexed variable of a material.

Description

rtMaterialGetVariable queries the handle of a material's indexed variable. material specifies the target material and should be a value returned by rtMaterialCreate. index specifies the index of the variable, and should be a value less than rtMaterialGetVariableCount. If material is a valid material and index is the index of a variable attached to material, *v is set to a handle to that variable. Otherwise, *v is set to NULL and either RT_ERROR_INVALID_VALUE or RT_ERROR_VARIABLE_NOT_FOUND is returned depending on the validity of material, or index, respectively.

Parameters
[in]materialSpecifies the material to query
[in]indexSpecifies the index of the variable to query
[out]vReturns the indexed variable

Return values

Relevant return values:

History

rtMaterialGetVariable was introduced in OptiX 1.0.

See also rtMaterialQueryVariable, rtMaterialGetVariableCount, rtMaterialCreate

RTresult RTAPI rtMaterialGetVariableCount ( RTmaterial  material,
unsigned int *  count 
)

Returns the number of variables attached to a material.

Description

rtMaterialGetVariableCount queries the number of variables attached to a material. material specifies the material, and should be a value returned by rtMaterialCreate. After the call, if both parameters are valid, the number of variables attached to material is returned to *count. Otherwise, the call has no effect and returns RT_ERROR_INVALID_VALUE.

Parameters
[in]materialSpecifies the material to query
[out]countReturns the number of variables

Return values

Relevant return values:

History

rtMaterialGetVariableCount was introduced in OptiX 1.0.

See also rtMaterialCreate

RTresult RTAPI rtMaterialQueryVariable ( RTmaterial  material,
const char *  name,
RTvariable v 
)

Queries for the existence of a named variable of a material.

Description

rtMaterialQueryVariable queries for the existence of a material's named variable. material specifies the target material and should be a value returned by rtMaterialCreate. name specifies the name of the variable, and should be a NULL-terminated string. If material is a valid material and name is the name of a variable attached to material, *v is set to a handle to that variable after the call. Otherwise, *v is set to NULL. If material is not a valid material, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]materialSpecifies the material to query
[in]nameSpecifies the name of the variable to query
[out]vReturns a the named variable, if it exists

Return values

Relevant return values:

History

rtMaterialQueryVariable was introduced in OptiX 1.0.

See also rtMaterialGetVariable, rtMaterialCreate

RTresult RTAPI rtMaterialRemoveVariable ( RTmaterial  material,
RTvariable  v 
)

Removes a variable from a material.

Description

rtMaterialRemoveVariable removes a variable from a material. The material of interest is specified by material, which should be a value returned by rtMaterialCreate. The variable to remove is specified by v, which should be a value returned by rtMaterialDeclareVariable. Once a variable has been removed from this material, another variable with the same name as the removed variable may be declared. If material does not refer to a valid material, this call has no effect and returns RT_ERROR_INVALID_VALUE. If v is not a valid variable or does not belong to material, this call has no effect and returns RT_ERROR_INVALID_VALUE or RT_ERROR_VARIABLE_NOT_FOUND, respectively.

Parameters
[in]materialSpecifies the material to modify
[in]vSpecifies the variable to remove

Return values

Relevant return values:

History

rtMaterialRemoveVariable was introduced in OptiX 1.0.

See also rtMaterialDeclareVariable, rtMaterialCreate

RTresult RTAPI rtMaterialSetAnyHitProgram ( RTmaterial  material,
unsigned int  rayTypeIndex,
RTprogram  program 
)

Sets the any hit program associated with a (material, ray type) tuple.

Description

rtMaterialSetAnyHitProgram specifies an any hit program to associate with a (material, ray type) tuple. material specifies the target material and should be a value returned by rtMaterialCreate. rayTypeIndex specifies the type of ray to which the program applies and should be a value less than the value returned by rtContextGetRayTypeCount. program specifies the target any hit program which applies to the tuple (material, rayTypeIndex) and should be a value returned by either rtProgramCreateFromPTXString or rtProgramCreateFromPTXFile.

Parameters
[in]materialSpecifies the material of the (material, ray type) tuple to modify
[in]rayTypeIndexSpecifies the type of ray of the (material, ray type) tuple to modify
[in]programSpecifies the any hit program to associate with the (material, ray type) tuple

Return values

Relevant return values:

History

rtMaterialSetAnyHitProgram was introduced in OptiX 1.0.

See also rtMaterialGetAnyHitProgram, rtMaterialCreate, rtContextGetRayTypeCount, rtProgramCreateFromPTXString, rtProgramCreateFromPTXFile

RTresult RTAPI rtMaterialSetClosestHitProgram ( RTmaterial  material,
unsigned int  rayTypeIndex,
RTprogram  program 
)

Sets the closest hit program associated with a (material, ray type) tuple.

Description

rtMaterialSetClosestHitProgram specifies a closest hit program to associate with a (material, ray type) tuple. material specifies the material of interest and should be a value returned by rtMaterialCreate. rayTypeIndex specifies the type of ray to which the program applies and should be a value less than the value returned by rtContextGetRayTypeCount. program specifies the target closest hit program which applies to the tuple (material, rayTypeIndex) and should be a value returned by either rtProgramCreateFromPTXString or rtProgramCreateFromPTXFile.

Parameters
[in]materialSpecifies the material of the (material, ray type) tuple to modify
[in]rayTypeIndexSpecifies the ray type of the (material, ray type) tuple to modify
[in]programSpecifies the closest hit program to associate with the (material, ray type) tuple

Return values

Relevant return values:

History

rtMaterialSetClosestHitProgram was introduced in OptiX 1.0.

See also rtMaterialGetClosestHitProgram, rtMaterialCreate, rtContextGetRayTypeCount, rtProgramCreateFromPTXString, rtProgramCreateFromPTXFile

RTresult RTAPI rtMaterialValidate ( RTmaterial  material)

Verifies the state of a material.

Description

rtMaterialValidate checks material for completeness. If material or any of the objects attached to material are not valid, returns RT_ERROR_INVALID_VALUE.

Parameters
[in]materialSpecifies the material to be validated

Return values

Relevant return values:

History

rtMaterialValidate was introduced in OptiX 1.0.

See also rtMaterialCreate

RTresult RTAPI rtPostProcessingStageCreateBuiltin ( RTcontext  context,
const char *  builtinName,
RTpostprocessingstage stage 
)

Creates a new post-processing stage.

Description

rtPostProcessingStageCreateBuiltin creates a new post-processing stage selected from a list of pre-defined post-processing stages. The context specifies the target context, and should be a value returned by rtContextCreate. Sets *stage to the handle of a newly created stage within context.

Parameters
[in]contextSpecifies the rendering context to which the post-processing stage belongs
[in]builtinNameThe name of the built-in stage to instantiate
[out]stageNew post-processing stage handle

Return values

Relevant return values:

History

rtPostProcessingStageCreateBuiltin was introduced in OptiX 5.0.

See also rtPostProcessingStageDestroy, rtPostProcessingStageGetContext, rtPostProcessingStageQueryVariable, rtPostProcessingStageGetVariableCount rtPostProcessingStageGetVariable

RTresult RTAPI rtPostProcessingStageDeclareVariable ( RTpostprocessingstage  stage,
const char *  name,
RTvariable v 
)

Declares a new named variable associated with a PostprocessingStage.

Description

rtPostProcessingStageDeclareVariable declares a new variable associated with a postprocessing stage. stage specifies the post-processing stage, and should be a value returned by rtPostProcessingStageCreateBuiltin. name specifies the name of the variable, and should be a NULL-terminated string. If there is currently no variable associated with stage named name, a new variable named name will be created and associated with stage. After the call, *v will be set to the handle of the newly-created variable. Otherwise, *v will be set to NULL. After declaration, the variable can be queried with rtPostProcessingStageQueryVariable or rtPostProcessingStageGetVariable. A declared variable does not have a type until its value is set with one of the rtVariableSet functions. Once a variable is set, its type cannot be changed anymore.

Parameters
[in]stageSpecifies the associated postprocessing stage
[in]nameThe name that identifies the variable
[out]vReturns a handle to a newly declared variable

Return values

Relevant return values:

History

rtPostProcessingStageDeclareVariable was introduced in OptiX 5.0.

See also Variables, rtPostProcessingStageQueryVariable, rtPostProcessingStageGetVariable

RTresult RTAPI rtPostProcessingStageDestroy ( RTpostprocessingstage  stage)

Destroy a post-processing stage.

Description

rtPostProcessingStageDestroy destroys a post-processing stage from its context and deletes it. The variables built into the stage are destroyed. After the call, stage is no longer a valid handle. After a post-processing stage was destroyed all command lists containing that stage are invalidated and can no longer be used.

Parameters
[in]stageHandle of the post-processing stage to destroy

Return values

Relevant return values:

History

rtPostProcessingStageDestroy was introduced in OptiX 5.0.

See also rtPostProcessingStageCreateBuiltin, rtPostProcessingStageGetContext, rtPostProcessingStageQueryVariable, rtPostProcessingStageGetVariableCount rtPostProcessingStageGetVariable

RTresult RTAPI rtPostProcessingStageGetContext ( RTpostprocessingstage  stage,
RTcontext context 
)

Returns the context associated with a post-processing stage.

Description

rtPostProcessingStageGetContext queries a stage for its associated context. stage specifies the post-processing stage to query, and should be a value returned by rtPostProcessingStageCreateBuiltin. If both parameters are valid, *context is set to the context associated with stage. Otherwise, the call has no effect and returns RT_ERROR_INVALID_VALUE.

Parameters
[in]stageSpecifies the post-processing stage to query
[out]contextReturns the context associated with the material

Return values

Relevant return values:

History

rtPostProcessingStageGetContext was introduced in OptiX 5.0.

See also rtPostProcessingStageCreateBuiltin, rtPostProcessingStageDestroy, rtPostProcessingStageQueryVariable, rtPostProcessingStageGetVariableCount rtPostProcessingStageGetVariable

RTresult RTAPI rtPostProcessingStageGetVariable ( RTpostprocessingstage  stage,
unsigned int  index,
RTvariable variable 
)

Returns a handle to a variable of a post-processing stage. The variable is defined by index.

Description

rtPostProcessingStageGetVariable queries the handle of a post-processing stage's variable which is identified by its index . stage specifies the source post-processing stage, as returned by rtPostProcessingStageCreateBuiltin. index specifies the index of the variable, and should be a less than the value return by rtPostProcessingStageGetVariableCount. If index is in the valid range, the call returns a handle to that variable in *variable, otherwise NULL.

Parameters
[in]stageThe post-processing stage to query the variable from
[in]indexThe index identifying the variable to be returned
[out]variableReturns the variable

Return values

Relevant return values:

History

rtPostProcessingStageGetVariable was introduced in OptiX 5.0.

See also rtPostProcessingStageCreateBuiltin, rtPostProcessingStageDestroy, rtPostProcessingStageGetContext, rtPostProcessingStageQueryVariable, rtPostProcessingStageGetVariableCount

RTresult RTAPI rtPostProcessingStageGetVariableCount ( RTpostprocessingstage  stage,
unsigned int *  count 
)

Returns the number of variables pre-defined in a post-processing stage.

Description

rtPostProcessingStageGetVariableCount returns the number of variables which are pre-defined in a post-processing stage. This can be used to iterate over the variables. Sets *count to the number.

Parameters
[in]stageThe post-processing stage to query the number of variables from
[out]countReturns the number of pre-defined variables

Return values

Relevant return values:

History

rtPostProcessingStageGetVariableCount was introduced in OptiX 5.0.

See also rtPostProcessingStageCreateBuiltin, rtPostProcessingStageDestroy, rtPostProcessingStageGetContext, rtPostProcessingStageQueryVariable, rtPostProcessingStageGetVariable

RTresult RTAPI rtPostProcessingStageQueryVariable ( RTpostprocessingstage  stage,
const char *  name,
RTvariable variable 
)

Returns a handle to a named variable of a post-processing stage.

Description

rtPostProcessingStageQueryVariable queries the handle of a post-processing stage's named variable. stage specifies the source post-processing stage, as returned by rtPostProcessingStageCreateBuiltin. name specifies the name of the variable, and should be a NULL -terminated string. If name is the name of a variable attached to stage, the call returns a handle to that variable in *variable, otherwise NULL. Only pre-defined variables of that built-in stage type can be queried. It is not possible to add or remove variables.

Parameters
[in]stageThe post-processing stage to query the variable from
[in]nameThe name that identifies the variable to be queried
[out]variableReturns the named variable

Return values

Relevant return values:

History

rtPostProcessingStageQueryVariable was introduced in OptiX 5.0.

See also rtPostProcessingStageCreateBuiltin, rtPostProcessingStageDestroy, rtPostProcessingStageGetContext, rtPostProcessingStageGetVariableCount rtPostProcessingStageGetVariable

RTresult RTAPI rtProgramCallsiteSetPotentialCallees ( RTprogram  program,
const char *  name,
const int *  ids,
int  numIds 
)

Sets the program ids that may potentially be called at a call site.

Description

rtProgramCallsiteSetPotentialCallees specifies the program IDs of potential callees at the call site in the program identified by name to the li