...
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.
Code Block | ||
---|---|---|
| ||
// Query ray depths for each point in the shading context |
...
int |
...
nPts = shadingCtx->numPts; |
...
int* rayDepths = |
...
new |
...
int |
...
[nPts]; |
...
if |
...
(vCtx->GetProperty(k_RayDepth, rayDepths)) |
...
{ // Do something expensive for small ray depths, or something cheaper for large |
...
ray depths } delete[] rayDepths; |
For documentation on the available ray properties, please consult the integrator ray property query documentationquery documentation
.