...
RixShadingContext
provides a limited service for tracing rays. The GetNearestHits()
routine allows shaders to trace rays to determine the nearest hit. These rays do not trigger shading on the hit geometry, and should thus be considered geometric probe rays: the only information that can be returned from GetNearestHits
is a RtHitPoint
struct, which contains a minimal set of geometric information including the distance, the P
, Ng
, u
, v
builtins of the hit geometry, and the filter and micropolygon sizes. A ray that missed is indicated by the distance being set to 0. While limited, this service is sufficient to allow for calculation of effects such as ambient occlusion. This service should not be confused with the RixIntegratorContext
ability to trace rays, which is provided only to implementors of RixIntegrator
.
Anchor | ||||
---|---|---|---|---|
|
...
In addition, transform matrices between two coordinate systems can be returned directly via the GetTransform()
method. The matrix
output parameter points at storage allocated by the renderer containing the matrices. The size of this storage is indicated by the numMatrices
output parameter. If the transformation is time varying, the numMatrices
returned will be the same as numPts
. If the transformation is uniform, numMatrices
will be set to 1. A non-zero return value indicates a failed transformation, typically due to unknown coordinate systems being specified.
Anchor | ||||
---|---|---|---|---|
|
As long as the RixIntegrator
used supports the appropriate ray property query, plugin authors may want to query ray properties such as the ray depth or eye throughput, in order to allow for artistic control or optimization. For instance, as an optimization a RixBxdf
may want to skip the evaluation of a particularly expensive lobe, if the current ray depth of the hit point is beyond some arbitrary threshold. This service is provided by the GetProperty()
routine on the RixShadingContext. C
allers of this routine are responsible for allocating and deallocating the result
memory. The integrator is responsible for filling in the result. Below is a code snippet demonstrating how to use this feature.
|
For documentation on the available ray properties, please consult the integrator ray property query documentation.