OptiX
3.9
NVIDIA OptiX Acceleration Engine
|
Simple API for performing raytracing queries using OptiX or the CPU.
Go to the source code of this file.
Macros | |
#define | RTU_INLINE static inline |
#define | RTU_CHECK_ERROR(func) |
#define | RTU_GROUP_ADD_CHILD(_parent, _child, _index) |
#define | RTU_SELECTOR_ADD_CHILD(_parent, _child, _index) |
Functions | |
RTresult RTAPI | rtuNameForType (RTobjecttype type, char *buffer, RTsize bufferSize) |
RTresult RTAPI | rtuGetSizeForRTformat (RTformat format, size_t *size) |
RTresult RTAPI | rtuCUDACompileString (const char *source, const char **preprocessorArguments, unsigned int numPreprocessorArguments, RTsize *resultSize, RTsize *errorSize) |
RTresult RTAPI | rtuCUDACompileFile (const char *filename, const char **preprocessorArguments, unsigned int numPreprocessorArguments, RTsize *resultSize, RTsize *errorSize) |
RTresult RTAPI | rtuCUDAGetCompileResult (char *result, char *error) |
RTresult RTAPI | rtuCreateClusteredMesh (RTcontext context, unsigned int usePTX32InHost64, RTgeometry *mesh, unsigned int num_verts, const float *verts, unsigned int num_tris, const unsigned *indices, const unsigned *mat_indices) |
RTresult RTAPI | rtuCreateClusteredMeshExt (RTcontext context, unsigned int usePTX32InHost64, RTgeometry *mesh, unsigned int num_verts, const float *verts, unsigned int num_tris, const unsigned *indices, const unsigned *mat_indices, RTbuffer norms, const unsigned *norm_indices, RTbuffer tex_coords, const unsigned *tex_indices) |
RTU_INLINE RTresult | rtuGroupAddChild (RTgroup group, RTobject child, unsigned int *index) |
RTU_INLINE RTresult | rtuSelectorAddChild (RTselector selector, RTobject child, unsigned int *index) |
RTU_INLINE RTresult | rtuGeometryGroupAddChild (RTgeometrygroup geometrygroup, RTgeometryinstance child, unsigned int *index) |
RTU_INLINE RTresult | rtuTransformSetChild (RTtransform transform, RTobject child) |
RTU_INLINE RTresult | rtuTransformGetChild (RTtransform transform, RTobject *type) |
RTU_INLINE RTresult | rtuTransformGetChildType (RTtransform transform, RTobjecttype *type) |
RTU_INLINE RTresult | rtuGroupRemoveChild (RTgroup group, RTobject child) |
RTU_INLINE RTresult | rtuSelectorRemoveChild (RTselector selector, RTobject child) |
RTU_INLINE RTresult | rtuGeometryGroupRemoveChild (RTgeometrygroup geometrygroup, RTgeometryinstance child) |
RTU_INLINE RTresult | rtuGroupRemoveChildByIndex (RTgroup group, unsigned int index) |
RTU_INLINE RTresult | rtuSelectorRemoveChildByIndex (RTselector selector, unsigned int index) |
RTU_INLINE RTresult | rtuGeometryGroupRemoveChildByIndex (RTgeometrygroup geometrygroup, unsigned int index) |
RTU_INLINE RTresult | rtuGroupGetChildIndex (RTgroup group, RTobject child, unsigned int *index) |
RTU_INLINE RTresult | rtuSelectorGetChildIndex (RTselector selector, RTobject child, unsigned int *index) |
RTU_INLINE RTresult | rtuGeometryGroupGetChildIndex (RTgeometrygroup geometrygroup, RTgeometryinstance child, unsigned int *index) |
#define RTU_CHECK_ERROR | ( | func | ) |
#define RTU_GROUP_ADD_CHILD | ( | _parent, | |
_child, | |||
_index | |||
) |
#define RTU_SELECTOR_ADD_CHILD | ( | _parent, | |
_child, | |||
_index | |||
) |
RTresult RTAPI rtuCreateClusteredMesh | ( | RTcontext | context, |
unsigned int | usePTX32InHost64, | ||
RTgeometry * | mesh, | ||
unsigned int | num_verts, | ||
const float * | verts, | ||
unsigned int | num_tris, | ||
const unsigned * | indices, | ||
const unsigned * | mat_indices | ||
) |
Create clustered triangle mesh for good memory coherence with paging on. Vertex, index and material buffers are created and attached to the mesh. Cluster's bounding box and intersection programs are attached to the mesh. The intersection program has the following attributes:
Created RTgeometry mesh expects there to be placed into a RTgeometryinstance where the mat_indices specified map into materials attached to the RTgeometryinstance
In the event of an error, please query the error string from the RTcontext.
context | Context |
usePTX32InHost64 | Use 32bit PTX bounding box and intersection programs in 64bit application. Takes effect only with 64bit host. |
mesh | Output geometry |
num_verts | Vertex count |
verts | Vertices (num_verts*float*3) [ v1_x, v1_y, v1_z, v2.x, ... ] |
num_tris | Triangle count |
indices | Vertex indices (num_tris*unsigned*3) [ tri1_index1, tr1_index2, ... ] |
mat_indices | Indices of materials (num_tris*unsigned) [ tri1_mat_index, tri2_mat_index, ... ] |
RTresult RTAPI rtuCreateClusteredMeshExt | ( | RTcontext | context, |
unsigned int | usePTX32InHost64, | ||
RTgeometry * | mesh, | ||
unsigned int | num_verts, | ||
const float * | verts, | ||
unsigned int | num_tris, | ||
const unsigned * | indices, | ||
const unsigned * | mat_indices, | ||
RTbuffer | norms, | ||
const unsigned * | norm_indices, | ||
RTbuffer | tex_coords, | ||
const unsigned * | tex_indices | ||
) |
Create clustered triangle mesh for good memory coherence with paging on. Buffers for vertices, indices, normals, indices of normals, texture coordinates, indices of texture coordinates and materials are created and attached to the mesh. Cluster's bounding box and intersection programs are attached to the mesh. The intersection program has the following attributes:
Created RTgeometry mesh expects there to be placed into a RTgeometryinstance where the mat_indices specified map into materials attached to the RTgeometryinstance
Vertex, normal and texture coordinate buffers can be shared between many geometry objects
In the event of an error, please query the error string from the RTcontext.
context | Context |
usePTX32InHost64 | Use 32bit PTX bounding box and intersection programs in 64bit application. Takes effect only with 64bit host. |
mesh | Output geometry |
num_verts | Vertex count |
verts | Vertices (num_verts*float*3) [ v1_x, v1_y, v1_z, v2.x, ... ] |
num_tris | Triangle count |
indices | Vertex indices (num_tris*unsigned*3) [ tri1_index1, tr1_index2, ... ] |
mat_indices | Indices of materials (num_tris*unsigned) [ tri1_mat_index, tri2_mat_index, ... ] |
norms | Normals (num_norms*float*3) [ v1_x, v1_y, v1_z, v2.x, ... ] |
norm_indices | Indices of vertex normals (num_tris*unsigned*3) [ tri1_norm_index1, tri1_norm_index2 ... ] |
tex_coords | Texture uv coords (num_tex_coords*float*2) [ t1_u, t1_v, t2_u ... ] |
tex_indices | Indices of texture uv (num_tris*unsigned*3) [ tri1_tex_index1, tri1_tex_index2 ... ] |
RTresult RTAPI rtuCUDACompileFile | ( | const char * | filename, |
const char ** | preprocessorArguments, | ||
unsigned int | numPreprocessorArguments, | ||
RTsize * | resultSize, | ||
RTsize * | errorSize | ||
) |
Compile a cuda source file.
[in] | filename | source code file name |
[in] | preprocessorArguments | list of preprocessor arguments |
[in] | numPreprocessorArguments | number of preprocessor arguments |
[out] | resultSize | size required to hold compiled result string |
[out] | errorSize | size required to hold error string |
RTresult | Return code |
RTresult RTAPI rtuCUDACompileString | ( | const char * | source, |
const char ** | preprocessorArguments, | ||
unsigned int | numPreprocessorArguments, | ||
RTsize * | resultSize, | ||
RTsize * | errorSize | ||
) |
Compile a cuda source string.
[in] | source | source code string |
[in] | preprocessorArguments | list of preprocessor arguments |
[in] | numPreprocessorArguments | number of preprocessor arguments |
[out] | resultSize | size required to hold compiled result string |
[out] | errorSize | size required to hold error string |
RTresult | Return code |
RTresult RTAPI rtuCUDAGetCompileResult | ( | char * | result, |
char * | error | ||
) |
Get the result of the most recent call to one of the above compile functions. The 'result' and 'error' parameters must point to memory large enough to hold the respective strings, as returned by the compile function.
[out] | result | compiled result string |
[out] | error | error string |
RTresult | Return code |
RTU_INLINE RTresult rtuGeometryGroupAddChild | ( | RTgeometrygroup | geometrygroup, |
RTgeometryinstance | child, | ||
unsigned int * | index | ||
) |
Add an entry to the end of the child array. Fills 'index' with the index of the added child, if the pointer is non-NULL.
RTU_INLINE RTresult rtuGeometryGroupGetChildIndex | ( | RTgeometrygroup | geometrygroup, |
RTgeometryinstance | child, | ||
unsigned int * | index | ||
) |
Use a linear search to find the child in the child array, and return its index. Returns RT_SUCCESS if the child was found, RT_ERROR_INVALID_VALUE otherwise.
RTU_INLINE RTresult rtuGeometryGroupRemoveChild | ( | RTgeometrygroup | geometrygroup, |
RTgeometryinstance | child | ||
) |
Find the given child using a linear search in the child array and remove it. If it's not the last entry in the child array, the last entry in the array will replace the deleted entry, in order to shrink the array size by one.
RTU_INLINE RTresult rtuGeometryGroupRemoveChildByIndex | ( | RTgeometrygroup | geometrygroup, |
unsigned int | index | ||
) |
Remove the child at the given index in the child array. If it's not the last entry in the child array, the last entry in the array will replace the deleted entry, in order to shrink the array size by one.
Return the size of a given RTformat. RT_FORMAT_USER and RT_FORMAT_UNKNOWN return 0. Returns RT_ERROR_INVALID_VALUE if the format isn't recognized, RT_SUCCESS otherwise.
[in] | format | OptiX format |
[out] | size | Size of the format |
RTresult | Return code |
Add an entry to the end of the child array. Fills 'index' with the index of the added child, if the pointer is non-NULL.
Use a linear search to find the child in the child array, and return its index. Returns RT_SUCCESS if the child was found, RT_ERROR_INVALID_VALUE otherwise.
Find the given child using a linear search in the child array and remove it. If it's not the last entry in the child array, the last entry in the array will replace the deleted entry, in order to shrink the array size by one.
Remove the child at the given index in the child array. If it's not the last entry in the child array, the last entry in the array will replace the deleted entry, in order to shrink the array size by one.
RTresult RTAPI rtuNameForType | ( | RTobjecttype | type, |
char * | buffer, | ||
RTsize | bufferSize | ||
) |
Get the name string of a given type. See RTobjecttype for more information.
[in] | type | Type requested |
[out] | buffer | Buffer to output the name string |
[in] | bufferSize | Size of the provided buffer |
RTresult | Return code |
RTU_INLINE RTresult rtuSelectorAddChild | ( | RTselector | selector, |
RTobject | child, | ||
unsigned int * | index | ||
) |
Add an entry to the end of the child array. Fills 'index' with the index of the added child, if the pointer is non-NULL.
RTU_INLINE RTresult rtuSelectorGetChildIndex | ( | RTselector | selector, |
RTobject | child, | ||
unsigned int * | index | ||
) |
Use a linear search to find the child in the child array, and return its index. Returns RT_SUCCESS if the child was found, RT_ERROR_INVALID_VALUE otherwise.
RTU_INLINE RTresult rtuSelectorRemoveChild | ( | RTselector | selector, |
RTobject | child | ||
) |
Find the given child using a linear search in the child array and remove it. If it's not the last entry in the child array, the last entry in the array will replace the deleted entry, in order to shrink the array size by one.
RTU_INLINE RTresult rtuSelectorRemoveChildByIndex | ( | RTselector | selector, |
unsigned int | index | ||
) |
Remove the child at the given index in the child array. If it's not the last entry in the child array, the last entry in the array will replace the deleted entry, in order to shrink the array size by one.
RTU_INLINE RTresult rtuTransformGetChild | ( | RTtransform | transform, |
RTobject * | type | ||
) |
Wrap rtTransformGetChild and rtTransformGetChildType in order to provide a type-safe version for C++.
RTU_INLINE RTresult rtuTransformGetChildType | ( | RTtransform | transform, |
RTobjecttype * | type | ||
) |
Wrap rtTransformGetChild and rtTransformGetChildType in order to provide a type-safe version for C++.
RTU_INLINE RTresult rtuTransformSetChild | ( | RTtransform | transform, |
RTobject | child | ||
) |
Wrap rtTransformSetChild in order to provide a type-safe version for C++.