Functions | |
| void * | rtCreateContext (char *engine, char *requirements, char *parameters) |
| Create a context. | |
| void | rtBindContext (void *context) |
| Bind a context. | |
| void | rtDestroyContext (void *context) |
| Destroy a context. | |
| rtint | rtGetError () |
| Query error information. | |
| char * | rtGetString (rtint target) |
| Query various information global to the context. | |
| void * | rtGetProcAddress (char *procname) |
| Query address of a procedure for the context. | |
| void | rtWait (rtint status) |
| Wait for context status. | |
| void | rtContextEnv (rtint target, rtint value, void *data) |
| Set or query context environment parameters. | |
| void | rtGenScenes (rtint count, rtint *names) |
| Generate scene names. | |
| void | rtBindScene (rtint name) |
| Bind a scene name. | |
| void | rtDeleteScenes (rtint count, rtint *names) |
| Delete scene names. | |
| void | rtTraceRays (rtint count, void *value, void *callback, void *asynccallback) |
| Trace rays. | |
| void | rtBuild () |
| Build or update scene. | |
| void | rtGenGroups (rtint count, rtint *names) |
| Generate group names. | |
| void | rtBindGroup (rtint name) |
| Bind a group name. | |
| void | rtDeleteGroups (rtint count, rtint *names) |
| Delete group names. | |
| void | rtBegin () |
| Begin specifying the geometry of a group. | |
| void | rtEnd () |
| End specifying the geometry of a group. | |
| void | rtAddTrianglef (float *v0, float *v1, float *v2, void *value) |
| Add a triangle with single precision. | |
| void | rtAddTriangled (double *v0, double *v1, double *v2, void *value) |
| Add a triangle with double precision. | |
| void | rtGenModels (rtint count, rtint *names) |
| Generate model names. | |
| void | rtBindModel (rtint name) |
| Bind model name. | |
| void | rtDeleteModels (rtint count, rtint *names) |
| Delete model names. | |
| void | rtModelEnv (rtint target, rtint value, void *data) |
| Set or query model environment parameters. | |
| void | rtAddGroups (rtint count, rtint *names) |
| Add a list of groups to model. | |
| void | rtRemoveGroups (rtint count, rtint *names) |
| Remove a list of groups from model. | |
| void | rtClearModel () |
| Clear the list of groups of model. | |
| void | rtGenObjects (rtint count, rtint *names) |
| Generate object names. | |
| void | rtBindObject (rtint name) |
| Bind an object name. | |
| void | rtDeleteObjects (rtint count, rtint *names) |
| Delete object names. | |
| void | rtAttachModel (rtint name) |
| Attach a model to object. | |
| void | rtObjectValue (void *value) |
| Assign a value to object. | |
| void | rtCullFace (rtint mode) |
| Set the object face culling mode. | |
| void | rtLoadMatrixf (float *m) |
| Define the matrix of object with single precision. | |
| void | rtLoadMatrixd (double *m) |
| Define the matrix of object with double precision. | |
| void | rtSetParent (rtint name) |
| Set parent of object within the scene. | |
| void | rtGenSources (rtint count, rtint *names) |
| Generate source names. | |
| void | rtBindSource (rtint name) |
| Bind a source name. | |
| void | rtDeleteSources (rtint count, rtint *names) |
| Delete source names. | |
| void | rtSetOriginf (float *origin) |
| Set origin for a ray source in single precision. | |
| void | rtSetOrigind (double *origin) |
| Set origin for a ray source in double precision. | |
| void | rtGenBuffers (rtint count, rtint *names) |
| Generate buffer names. | |
| void | rtBindBuffer (rtint name) |
| Bind a buffer name. | |
| void | rtDeleteBuffers (rtint count, rtint *names) |
| Delete buffer names. | |
| void | rtBufferEnv (rtint target, rtint value, void *data) |
| Set buffer environment parameters. | |
| void | rtSupplyVectors (rtint stride, rtint type, void *pointer) |
| Provide ray vectors. | |
| void | rtSupplyTargets (rtint stride, rtint type, void *pointer) |
| Provide ray targets. | |
| void | rtSupplySources (rtint stride, rtint *names) |
| Provide source names. | |
| void | rtSupplyDisplacements (rtint stride, rtint type, void *pointer) |
| Provide ray displacements. | |
| void | rtSupplyEndSources (rtint stride, rtint *names) |
| Provide source names to set at ray end points. | |
| void | rtSupplyFlags (rtint stride, rtint *flags) |
| Provide ray flags. | |
| void | rtCollectHitCoords (rtint stride, rtint type, void *pointer) |
| Collect hit point coordinates. | |
| void | rtCollectUvCoords (rtint stride, rtint type, void *pointer) |
| Collect barycentric coordinates. | |
| void | rtCollectHitValues (rtint stride, void *pointer) |
| Collect values of intersected primitives. | |
| void | rtCollectObjectValues (rtint stride, void *pointer) |
| Collect values of intersected objects. | |
| void | rtCollectPlanes (rtint stride, rtint type, void *pointer) |
| Collect plane equations. | |
| void | rtCollectHitDistances (rtint stride, rtint type, void *pointer) |
| Collect distances from origin to hit points. | |
| void | rtRayCallback (rtint target, void *callback) |
| Set ray callback functions. | |
| void* rtCreateContext | ( | char * | engine, | |
| char * | requirements, | |||
| char * | parameters | |||
| ) |
Create a context.
| engine | String specifying the desired engine as identified by RT_ENGINE. | |
| requirements | Space-separated list of extensions and specifications required to be supported. | |
| parameters | Parameters to be passed to the implementation. |
The format of engine is expected to be identical or similar to the result of a call to rtGetString() with RT_ENGINE as parameter on a valid context. It is treated as a hint for fuzzy matching and may be ignored.
The requirements parameter is to be a list of items separated by space characters, and the created context created is garanteed to support all the capabilities or extensions requested. Consult extension specifications for the exact description of capabilities. rtCreateContext() will fail if no implementation can be found that supports all extensions and capabilities requested.
The parameter parameters is passed to the underlying implementation and its format is implementation dependant. It is treated as a hint and may not cause rtCreateContext() to fail.
All commands operate on the bound context ; scene, group, model, object, source and buffer entities are all specific to a context and can not be shared between multiple contexts. If resources are to be shared, use of multiple scenes within a same context is recommended.
| void rtBindContext | ( | void * | context | ) |
Bind a context.
| context | Specifies the context to be bound. |
All operations affect the bound context; object names, source names and buffer names are all specific to one context and can't be shared between multiple contexts.
| void rtDestroyContext | ( | void * | context | ) |
Destroy a context.
| context | Specifies the context to be destroyed. |
All commands operate on the bound context ; scene, group, model, object, source and buffer entities are all specific to a context and can not be shared between multiple contexts. If resources are to be shared, use of multiple scenes is advised.
| rtint rtGetError | ( | ) |
Query error information.
Each context is entirely independant from the others, each context also has its own error flag. The value of the error flag is undefined if there is no valid context bound.
Each error constant represents a bit of the error flag that can be tested to verify if the error occured. The errors are defined as follow :
| char* rtGetString | ( | rtint | target | ) |
Query various information global to the context.
| target | Specifies a symbolic constant, RT_PROVIDER, RT_ENGINE, RT_VERSION, RT_EXTENSIONS, RT_SPECIFICATIONS, RT_BUILD and RT_CONTACT are accepted. |
The parameter name can be one of the following:
All strings are zero terminated. If an error is generated, rtGetString() returns zero.
| void* rtGetProcAddress | ( | char * | procname | ) |
Query address of a procedure for the context.
| procname | Specifies the name of a command. |
rtGetProcAddress() is meant to be used to query the address of additional procedures exposed by extensions that may not be available on all implementations. If procname is unknown or unavailable for the current context, a zero pointer is returned.
| void rtWait | ( | rtint | status | ) |
Wait for context status.
| status | Specifies a symbolic constant indicating the desired behavior. RT_WAIT_HINT_NONBLOCK, RT_WAIT_HINT_ANY, RT_WAIT_HINT_ALL and RT_WAIT_HINT_READY are accepted. |
Callbacks are garanteed to be executed by the same thread that called rtWait() and stack alignment is preserved for the largest data type available to the architecture.
The parameter status describes what status is to be reached before the function returns. The accepted constants are :
| void rtContextEnv | ( | rtint | target, | |
| rtint | value, | |||
| void * | data | |||
| ) |
Set or query context environment parameters.
| target | Specifies an environment parameter. | |
| value | Specifies the value or mode to be assigned to the parameter. | |
| data | Specifies data to be assigned to the parameter. |
If target is RT_THREAD_COUNT_HINT, the command provides a hint to the implementation on the number of local concurrent threads for execution of the supplied commands. The count of threads is provided by the value parameter and may be clamped or ignored.
| void rtGenScenes | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Generate scene names.
| count | Specifies the number of scenes to be generated. | |
| names | Specifies an array in which the generated scene names are stored. |
Scene names returned by a call to rtGenScenes() are not returned by subsequent calls, unless they are first deleted with rtDeleteScenes(). The generated scenes are empty.
Scene entities are global to the current context. Object and source entities are specific to the currently bound scene when they are generated. Upon deletion of a scene, all objects and sources it contains are deleted.
| void rtBindScene | ( | rtint | name | ) |
Bind a scene name.
| name | Specifies the name of the scene to be bound. |
Scene entities are global to the current context. Object and source entities are specific to the currently bound scene when they are generated. Upon deletion of a scene, all objects and sources it contains are deleted.
| void rtDeleteScenes | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Delete scene names.
| count | Specifies the number of scenes to be deleted. | |
| names | Specifies an array of scene names to be deleted. |
rtDeleteScenes() skips names that do not correspond to existing scenes, setting the error flag to RT_INVALID_NAME.
Scene entities are global to the current context. Object and source entities are specific to the currently bound scene when they are generated. Upon deletion of a scene, all objects and sources it contains are deleted.
| void rtTraceRays | ( | rtint | count, | |
| void * | value, | |||
| void * | callback, | |||
| void * | asynccallback | |||
| ) |
Trace rays.
| count | Specifies the count of rays to be traced. | |
| value | Specifies a value to be passed to the callback function. | |
| callback | Specifies the address of a callback function. | |
| asynccallback | Specifies the address of an asynchroneous callback function. |
The callback and asynchroneous callback functions are to be defined as :
void callback(void *value, rtint status);The parameter value is the same value that was specified as parameter to the rtTraceRays() command. The status parameter is defined to be zero on success. During ray-tracing operations, the currently bound buffer is locked until callback is executed and no command is allowed on this buffer except rtDeleteBuffers(). If the buffer, scene or context attached to the queued ray-tracing command is deleted prior to completion of the task, the specified callback shall be executed prior to the return of the entity deletion function. The parameter status of the callback function may be zero if the task was completed or RT_CANCELED_OPERATION to indicate failure. Other non-zero values for the status parameter may indicate an incorrect buffer state.
Several attributes may be provided for each ray as follows : ray vectors, source names to use as the origin of each ray, displacement from the origin of each ray, source names to be updated to match the ray intersection points, and additional flags for each ray.
Vectors are mandatory to be provided by the currently bound buffer as set by rtSupplyVectors(). All vectors are required to be non-zero in length or behavior is undefined.
By default, the origin of all rays is set to the origin of the currently bound source. Alternatively, the command rtSupplySources() can be used to assign to the current buffer an array of source names to define the origin of rays.
Displacements from the origin of rays can be provided through the command rtSupplyDisplacements().
Rays can update the origin of sources to the points of intersection with the scene geometry. The command rtSupplyEndSources() is used to set the location where the currently bound buffer is to read the source names.
Additional flags may be provided for each ray by the command rtSupplyFlags().
Two mechanisms are provided to receive the results from the ray-tracing operation ; data collection and ray callbacks. See rtBufferEnv() for more information.
| void rtBuild | ( | ) |
Build or update scene.
rtBuild() updates the currently bound scene. It is a required operation prior to tracing rays whenever changes have been made to any object, models or groups present in the scene.
Upon the execution of rtBuild(), the origin of all sources within the scene are invalidated. Behavior is undefined if sources are used before being given assigned a new origin.
| void rtGenGroups | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Generate group names.
| count | Specifies the number of groups to be generated. | |
| names | Specifies an array in which the generated group names are stored. |
Group names returned by a call to rtGenGroups() are not returned by subsequent calls, unless they are first deleted with rtDeleteGroups(). The generated groups are empty.
Group entities are global to the current context.
| void rtBindGroup | ( | rtint | name | ) |
Bind a group name.
| name | Specifies the name of the group to be bound. |
A pair of rtBegin() and rtEnd() commands can be used to define the geometry of the currently bound group. It replaces any geometry the group contains.
Group entities are global to the current context.
| void rtDeleteGroups | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Delete group names.
| count | Specifies the number of groups to be deleted. | |
| names | Specifies an array of group names to be deleted. |
rtDeleteGroups() skips names that do not correspond to existing groups, setting the error flag to RT_INVALID_NAME.
If a group is present in the definition of any model, rtDeleteGroups() will skip it, setting the error flag to RT_INVALID_OPERATION.
Group entities are global to the current context.
| void rtBegin | ( | ) |
Begin specifying the geometry of a group.
rtBegin() and rtEnd() delimit the geometry that define a group. If the group contains any geometry at the moment rtBegin() is executed, it is cleared.
rtBegin() locks the current context used until the next rtEnd() command, between which only commands to define the current group can be used. The rtAddTrianglef() and rtAddTriangled() commands add a triangle to the definition of a group. Implementations may expose additional primitives through extensions.
If the group is present in the definition of any model, rtBegin() will fail, setting the error flag to RT_INVALID_OPERATION.
Operations outside the scope of the current context are always valid, specifically rtCreateContext(), rtBindContext() and rtDestroyContext(). If any other command is executed between rtBegin() and rtEnd(), the error flag is set and the command is ignored.
Additional note : Support for modifications of the content of groups without clearing them is planned.
| void rtEnd | ( | ) |
| void rtAddTrianglef | ( | float * | v0, | |
| float * | v1, | |||
| float * | v2, | |||
| void * | value | |||
| ) |
Add a triangle with single precision.
| v0 | Specifies a pointer to an array of 3 elements, the x, y and z coordinates of the first vertex. | |
| v1 | Specifies a pointer to an array of 3 elements, the x, y and z coordinates of the second vertex. | |
| v2 | Specifies a pointer to an array of 3 elements, the x, y and z coordinates of the third vertex. | |
| value | Specifies a value to be assigned to the triangle. |
The parameter value is assigned to the triangle primitive. During ray-tracing operations, value can be provided to identify the primitive hit by rays, see rtCollectHitValues(), rtBufferEnv() and rtRayCallback().
| void rtAddTriangled | ( | double * | v0, | |
| double * | v1, | |||
| double * | v2, | |||
| void * | value | |||
| ) |
Add a triangle with double precision.
| v0 | Specifies a pointer to an array of 3 elements, the x, y and z coordinates of the first vertex. | |
| v1 | Specifies a pointer to an array of 3 elements, the x, y and z coordinates of the second vertex. | |
| v2 | Specifies a pointer to an array of 3 elements, the x, y and z coordinates of the third vertex. | |
| value | Specifies a value to be assigned to the triangle. |
The parameter value is assigned to the triangle primitive. During ray-tracing operations, value can be provided to identify the primitive hit by rays, see rtCollectHitValues(), rtBufferEnv() and rtRayCallback().
| void rtGenModels | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Generate model names.
| count | Specifies the number of models to be generated. | |
| names | Specifies an array in which the generated model names are stored. |
Model names returned by a call to rtGenModels() are not returned by subsequent calls, unless they are first deleted with rtDeleteModels(). The generated models are empty.
Model entities are global to the current context.
| void rtBindModel | ( | rtint | name | ) |
Bind model name.
| name | Specifies the name of the model to be bound. |
Models hold a list of groups, the representation of a model being the sum of the geometry of the groups it contains. The commands rtAddGroups(), rtRemoveGroups() and rtClearModel() are used to manage the content of models.
Model entities are global to the current context.
| void rtDeleteModels | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Delete model names.
| count | Specifies the number of models to be deleted. | |
| names | Specifies an array of model names to be deleted. |
rtDeleteModels() skips names that do not correspond to existing models, setting the error flag to RT_INVALID_NAME.
If a model is attached to any object, rtDeleteModels() will skip it, setting the error flag to RT_INVALID_OPERATION.
Model entities are global to the current context.
| void rtModelEnv | ( | rtint | target, | |
| rtint | value, | |||
| void * | data | |||
| ) |
Set or query model environment parameters.
| target | Specifies an environment parameter. | |
| value | Specifies the value, mode or additional information assigned to the parameter. | |
| data | Specifies data related to the parameter. |
If target is RT_BUILD_QUALITY_HINT, RT_BUILD_SPEED_HINT or RT_BUILD_MEMORY_HINT, the command provides a hint for the preparation of the model. The value parameter can either be RT_FLOAT, RT_DOUBLE or RT_LOAD_DEFAULT. The first two constants instruct the implementation to read either one float or one double value from the data pointer. The RT_LOAD_DEFAULT resets the hint to the default implementation value. Before model building, the three hints are normalized so that their sum equals one.
A target of RT_GET_BUILD_SUMMARY retrieves various information on the model's internal representation. The data is written at the address specified in data up to a count of characters specified by value. While typically text, the format and information provided is implementation dependant.
| void rtAddGroups | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Add a list of groups to model.
| count | Specifies the number of groups to be added. | |
| names | Specifies an array in which the group names are read. |
rtAddGroups() skips names that do not correspond to existing groups, setting the error flag to RT_INVALID_NAME. rtAddGroups(), rtRemoveGroups() and rtClearModel() typically are inexpensive operations. Attaching a first object to the model notifies the implementation that the definition of the model is complete, at which point the model may be prepared for ray-tracing operations. See rtAttachModel().
Groups can not be redefined or deleted when in use by any model.
| void rtRemoveGroups | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Remove a list of groups from model.
| count | Specifies the number of groups to be removed. | |
| names | Specifies an array in which the group names are read. |
rtRemoveGroups() skips names that do not correspond to groups present in the model, setting the error flag to RT_INVALID_NAME. rtAddGroups(), rtRemoveGroups() and rtClearModel() typically are inexpensive operations. Attaching a first object to the model notifies the implementation that the definition of the model is complete, at which point the model may be prepared for ray-tracing operations. See rtAttachModel().
Groups can not be redefined or deleted when in use by any model.
| void rtClearModel | ( | ) |
Clear the list of groups of model.
rtClearModel() removes all groups from the definition of the currently bound model. No object must presently be attached to the model or the command fails and the error flag is set to RT_INVALID_OPERATION.
rtAddGroups(), rtRemoveGroups() and rtClearModel() typically are inexpensive operations. Attaching a first object to the model notifies the implementation that the definition of the model is complete, at which point the model may be prepared for ray-tracing operations. See rtAttachModel().
If the model is attached to any object, rtAddGroups() will fail, setting the error flag to RT_INVALID_OPERATION.
Groups can not be redefined or deleted when in use by any model.
| void rtGenObjects | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Generate object names.
| count | Specifies the number of objects to be generated. | |
| names | Specifies an array in which the generated object names are stored. |
Object names returned by a call to rtGenObjects() are not returned by subsequent calls, unless they are first deleted with rtDeleteObjects(). The generated objects are not attached to a model, contain an identity matrix, have a value of zero, have no parent and the culling mode is set to RT_NONE.
Object entities belong to the currently bound scene when generated. Upon deletion of a scene, all objects it contains are deleted.
| void rtBindObject | ( | rtint | name | ) |
Bind an object name.
| name | Specifies the name of the object to be bound. |
Objects are instances of models within a particular scene. They hold a matrix to define the position and orientation of the model's geometry within the scene or relatively to another object of the scene.
Object entities belong to the currently bound scene when generated. Upon deletion of a scene, all objects it contains are deleted.
| void rtDeleteObjects | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Delete object names.
| count | Specifies the number of objects to be deleted. | |
| names | Specifies an array of object names to be deleted. |
rtDeleteObjects() skips names that do not correspond to existing objects, setting the error flag to RT_INVALID_NAME.
Object entities belong to the currently bound scene when generated. Upon deletion of a scene, all objects it contains are deleted.
| void rtAttachModel | ( | rtint | name | ) |
Attach a model to object.
| name | Specifies the name of the model to attach. |
Attaching a model to an object can expose the model's geometry if the object is present within its scene. The matrix of the object defines the position and orientation of the geometry relatively to its parent during ray-tracing operations.
The symbolic constant RT_DETACH can be used for the parameter name to indicate that the object is to be detached from any model.
Models can not be modified or deleted when attached by any object.
| void rtObjectValue | ( | void * | value | ) |
Assign a value to object.
| value | Specifies the value to be assigned to the object. |
All primitives of the groups that compose the model attached to the object will return the same object value. To uniquely identify primitives, the value of the primitives themselves should be used.
| void rtCullFace | ( | rtint | mode | ) |
Set the object face culling mode.
| mode | Specifies the name of the model to attach. RT_BACK, RT_FRONT and RT_NONE are accepted. |
The accepted constants for the parameter mode are :
| void rtLoadMatrixf | ( | float * | m | ) |
Define the matrix of object with single precision.
| m | Specifies a pointer to a 4x4 matrix to be loaded. |
The sum of all the groups of a model define the geometry of the objects attached to it. The geometry is multipled by the matrix of the object to define its position and orientation within the space of the scene or the parent object.
The default matrix for objects is an identity matrix. Passing a zero pointer as m parameter loads an identity matrix for the object.
| void rtLoadMatrixd | ( | double * | m | ) |
Define the matrix of object with double precision.
| m | Specifies a pointer to a 4x4 matrix to be loaded. |
The sum of all the groups of a model define the geometry of the objects attached to it. The geometry is multipled by the matrix of the object to define its position and orientation within the space of the scene or the parent object.
The default matrix for objects is an identity matrix. Passing a zero pointer as m parameter loads an identity matrix for the object.
| void rtSetParent | ( | rtint | name | ) |
Set parent of object within the scene.
| name | Specifies the name of the object to set as parent or one of the two symbolic constants RT_ABSENT and RT_ROOT. |
The RT_ABSENT constant specifies that the object is absent from the scene. This is the default for newly generated objects. The RT_ROOT constant specifies that the object is the root object of the scene. There can only be one root object per scene and an existing root object has to be removed prior to specifying a new one.
Attempting to assign an invalid object name as parent sets the error flag to RT_INVALID_NAME but preserves the previously assigned parent. When an object is deleted, its child objects, if any, are marked as absent.
The sum of all the groups of a model define the geometry of the objects attached to it. The geometry is multipled by the matrix of the object to define its position and orientation within the space of the scene or the parent object.
| void rtGenSources | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Generate source names.
| count | Specifies the number of sources to be generated. | |
| names | Specifies an array in which the generated source names are stored. |
Source names returned by a call to rtGenSources() are not returned by subsequent calls, unless they are first deleted with rtDeleteSources(). The generated sources are undefined, origins must be specified prior to use in ray tracing operations.
Source entities belong to the currently bound scene when generated. Upon deletion of a scene, all sources it contains are deleted.
| void rtBindSource | ( | rtint | name | ) |
Bind a source name.
| name | Specifies the name of the source to be bound. |
Sources hold a point in the space of a scene from which rays can be traced. The commands rtSetOriginf() and rtSetOrigind() can be used to specify the origin of a source or it can be defined to match the intersection point of rays with the scene. See rtSupplyEndSources() for more information.
Source entities belong to the currently bound scene when generated. Upon deletion of a scene, all sources it contains are deleted.
| void rtDeleteSources | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Delete source names.
| count | Specifies the number of sources to be deleted. | |
| names | Specifies an array of source names to be deleted. |
rtDeleteSources() skips names that do not correspond to existing sources, setting the error flag to RT_INVALID_NAME.
Source entities belong to the currently bound scene when generated. Upon deletion of a scene, all sources it contains are deleted.
| void rtSetOriginf | ( | float * | origin | ) |
Set origin for a ray source in single precision.
| origin | Specifies a pointer to an array to a set of x, y and z coordinates. |
Unless source names are provided for each ray through the rtSupplySources() command, the currently bound source defines the origin of all rays when rtTraceRays() is called.
Rays can be displaced from the their respective sources, see rtSupplyDisplacements().
| void rtSetOrigind | ( | double * | origin | ) |
Set origin for a ray source in double precision.
| origin | Specifies a pointer to an array to a set of x, y and z coordinates. |
Unless source names are provided for each ray through the rtSupplySources() command, the currently bound source defines the origin of all rays when rtTraceRays() is called.
Rays can be displaced from the their respective sources, see rtSupplyDisplacements().
| void rtGenBuffers | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Generate buffer names.
| count | Specifies the number of buffers to be generated. | |
| names | Specifies an array in which the generated buffer names are stored. |
Buffer names returned by a call to rtGenBuffers() are not returned by subsequent calls, unless they are first deleted with rtDeleteBuffers(). The generated buffers are not attached to a model, contain an identity matrix, have a value of zero, have no parent and the culling mode is set to RT_NONE.
Buffer entities are global to the current context.
| void rtBindBuffer | ( | rtint | name | ) |
Bind a buffer name.
| name | Specifies the name of the buffer to be bound. |
Buffers are fundamental ray-tracing operation targets. They hold information on what ray attributes are provided and the location data is to be read from. When rtTraceRays() is executed, the parameters of the bound buffer also defines how ray-tracing results are returned. See the command rtBufferEnv() to define buffer environment parameters.
Buffer entities are global to the current context.
| void rtDeleteBuffers | ( | rtint | count, | |
| rtint * | names | |||
| ) |
Delete buffer names.
| count | Specifies the number of buffers to be deleted. | |
| names | Specifies an array of buffer names to be deleted. |
rtDeleteBuffers() skips names that do not correspond to existing buffers, setting the error flag to RT_INVALID_NAME.
Buffer entities are global to the current context.
| void rtBufferEnv | ( | rtint | target, | |
| rtint | value, | |||
| void * | data | |||
| ) |
Set buffer environment parameters.
| target | Specifies an environment parameter. | |
| value | Specifies the value or mode to be assigned to the parameter. | |
| data | Specifies data to be assigned to the parameter. |
If target is RT_COLLECTION_MODE, the command modifies the collection mode of the buffer. This defines how results are returned when rtTraceRays() is executed. The mode is specified by the value parameter, either RT_BUFFER_COLLECTION or RT_RAY_CALLBACK. The parameter data is ignored.
When the RT_BUFFER_COLLECTION mode is used, results are stored at the addresses specified by buffer collection commands such as rtCollectHitCoords(). The RT_RAY_CALLBACK mode causes results to be returned through callback functions. See rtRayCallback() for more information. The default collection mode is RT_BUFFER_COLLECTION.
If target is RT_SUPPLY_MASK, the parameter value is a bitwise mask to indicate what ray attributes are provided for ray-tracing operations. Unless otherwise specified, the attributes will be read at the addresses provided to the buffer for all enabled fields of the bitwise mask. The parameter data is ignored. The default value bitwise mask is zero. The values for the bitwise mask are defined as follows :
If target is RT_COLLECTION_MASK, the parameter value is a bitwise mask to indicate what results are to be returned by ray-tracing operations. For the RT_BUFFER_COLLECTION mode, results will be written at the addresses provided to the buffer for all enabled fields of the bitwise mask. If the collection mode is set to RT_RAY_CALLBACK, structure fields that were not specified in the bitwise mask contain undefined data. The parameter data must be zero. The default value bitwise mask is zero. The values for the bitwise mask are defined as follows :
If target is RT_RAY_FLAGS_MASK, value is a bitwise mask that defines the desired behavior for flags attributes supplied to rays. If the bit identified by the symbolic constant RT_FLAGS_SKIP_BIT of value is set, the implementation will skip rays identified by a flag where the bit RT_FLAGS_SKIP_BIT is set. For the RT_BUFFER_COLLECTION mode, this implies that results are undefined for skipped rays. For the RT_RAY_CALLBACK mode, callbacks are not executed for skipped rays. The parameter data must be zero. The default value bitwise mask is zero.
If target is RT_RAY_CALLBACK_TYPE, the parameter value defines the data type used for storage of floating point values for ray callbacks. The symbolic constants RT_FLOAT and RT_DOUBLE are accepted. See the rtRayCallback() command for more information. The default value is RT_FLOAT.
If target is RT_RAY_TRANSLATION, the parameter value defines the data type of the single floating point value to be read from data. The symbolic constants RT_FLOAT and RT_DOUBLE are accepted. If the RT_SUPPLY_TRANSLATION_BIT is defined in the supply mask of the buffer, all rays will be translated by the product of the translation constant and their respective vectors. The default translation is zero.
Buffer entities are global to the current context.
| void rtSupplyVectors | ( | rtint | stride, | |
| rtint | type, | |||
| void * | pointer | |||
| ) |
Provide ray vectors.
| type | Specifies the data type of the vectors. The symbolic constants RT_FLOAT and RT_DOUBLE are accepted. | |
| stride | Specifies the byte offset between cons |