Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • int numPts: The number of points in the shading context. All non-uniform values can be assumed to have this length.
  • struct scTraits: This struct contains several informational fields.
    • eyePath: A flag which is set to 1 if the shading context was created in the context of an eye path.
    • lightPath: A flag which is set to 1 if the shading context was created in the context of a bidirectional light path.
    • primaryHit: A flag which is set to 1 if the shading context is directly visible to the camera.
    • missContext: A flag which is set to 1 if the shading context represents a ray miss. A miss context has no geometric information associated with it, cannot provide primvar or parameter evaluation services, and the only available builtin variables will be the ones associated with the incident ray.
    • reyesGrid: A flag which is set to 1 if the shading context is associated with a tessellated micropolygon representation. This is true in certain displacement or cached execution contexts.
    • RixSCShadingMode shadingMode: This enumeration conveys the current mode associated with the current shader execution. Knowledge of the shading mode may allow the shader to minimize certain costs associated with the current execution, i.e. by avoiding certain parameter evaluations when it is known that those parameters do not pertain to the current execution.
    • bxdf, opacity, displacement, subsurface, volume: Pointers to instances of the appropriate shader type. It is rare for a shader to need knowledge of other shader types via these fields. If such knowledge is required, the use of the methods GetBxdf(), GetOpacity(), etc is encouraged instead of directly accessing the scTraits
  • int* integratorCtxIndex: This array contains a mapping from the shading context to arrays in the RixIntegratorContext: a shading point of index i is associated with the corresponding index integratorCtxIndex[i]. For example, the shading point with index i can figure out the camera ray that ultimately gave rise to the shading point by accessing the primaryRays[integratorCtxIndex[i]] field of RixIntegratorContext.
  • int* rayId: This array should usually be ignored by shaders. It is typically used by integrators to track a correspondence between the points in the shading context and any ray specific data structures in the integrator.
  • RtColorRGB *transmission: The transmittance associated with the incident ray. This transmittance will typically be non-zero if the incident ray traveled through participating media. Most shaders other than volume integrators will ignore this field, while integrators will need to inspect this field in order to compute the total transmittance along a path.
  • float *pointWeight: If the shading context was created via an importance sampling method, this is the associated weight of that method. Most shaders other than volume integrators will ignore this field, while integrators may need to multiply the shader contributions by this weight.
  • int *pointSampleCount: Only used by volume integrators to indicate the number of samples taken for multiple scattering. Integrators may need to multiply this value into the total path throughput.
  • RtColorRGB *opacityThroughput: Per-point part of the throughput resulting from opacity continuations along the ray that produced the associated hit.
  • RtColorRGB *opacity: Per-point combined opacity: the product of presence and opacity for the given point.
  • float *opacityStochasticWeight: Per-point probability hit-testing weight. Inverse of the probability of having selected this hit. When dealing with non-fully-opaque surfaces, and when using probabilistic hit-testing, the combined opacity can be interpreted as the probability that we actually hit the surface. When only considering a scalar presence value (i.e. opacity is one, so combined opacity is monochromatic), the probability is usually the inverse of the scalar presence value, and no special weighting needs to be applied to the shading on hits. However, when dealing with arbitrary combined opacity, it is necessary to weight the shading on hit by the product of: opacity (the combined opacity on hit), and opacityStochasticWeight ( the inverse hit-testing probability).
  • RixRNG *m_rngCtx: A per-point array of random number contexts. These can be used by shaders to generate stratified random numbers. A NULL value here means the current shading mode does not support random number generation, and shader writers should check for a NULL value before relying on these contexts.

...