Page tree

Versions Compared

Key

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

...

The RixBxdf interface characterizes the light-scattering behavior (sometimes referred to as material response) for a given point on the surface of an object.

RixBxdfFactory

RixBxdfFactory is a subclass of RixShadingPlugin, and therefore shares the same initializationsynchronization, and parameter table logic as other shading plugins. 

Integrators (RixIntegrator) use RixBxdfFactory objects by invoking RixBxdfFactory::BeginScatter()  to obtain a  RixBxdf. Because a RixBxdf is expected to be a lightweight object that may be created many times over the course of the render, RixBxdfFactory is expected to take advantage of the lightweight instancing services provided by RixShadingPlugin. In particular, BeginScatter() is provided a pointer to an instance data that is created by RixBxdfFactory::CreateInstanceData(), which is called only once per unique set of parameters supplied to the material description. It is expected that the instance data will point to a private cached representation of any expensive setup which depends on the parameters, and BeginScatter() will reuse this cached representation many times over the course of the render to create RixBxdf objects.

RixBxdfFactory::BeginScatter()  is expected to invoke  RixShadingContext::EvalParam() to invoke the relevant bxdf parameters. The bxdf acts as a closure, associated with a given shading context.  BeginScatter() will typically call a Bxdf constructor which will get the necessary built-in variables such as shading normal (Nn), geometric normal (Ngn), viewing direction (Vn), etc., by calling the RixShadingContext::GetBuiltinVar() function for each variable.

...