NVIDIA OptiX 6.0 API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Geometry functions

Functions

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 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)
 

Detailed Description

Functions related to an OptiX Geometry node.

Function Documentation

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 Variable setters 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 Variable functions, 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 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 functions 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 functions 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 functions 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 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