Page tree

Versions Compared

Key

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

...

The following diagram illustrates several fundamental builtin variables: the surface position P, the normalized shading normal Nn, and the parametric derivatives dPdu and dPdv, as well as Vlen and Vn which provide information about the incoming ray.





Primitive Variables
Anchor
getprimvar
getprimvar

Primitive variables (often referred to as primvars) represent values which may be optionally present on the geometry. These primvars are uniquely named and may be supplied with the geometry definition. Shaders are usually written knowing the name and data type of certain primvars in advance, such as texture coordinates. However, since the primvars are optional, shaders are expected to fail gracefully if the primvars are missing.

...

There are also variants of GetPrimVar() which return the partial derivatives of the primvar measured with respect to the builtin variables u and v. These methods may be used in certain conditions that are otherwise hard to filter correctly.

Parameter Evaluation
Anchor
evalparam
evalparam

Evaluation of the input parameters to the shader is provided via the EvalParam() methods. Input parameters may be constant (the direct parameters to the shader invocation), or may be connected to an upstream node and trigger an upstream of that node (and in turn, any of its dependencies). All such upstream computation will be automatically cached by the renderer for the duration of the RixShadingContext.

...