...
The RixBxdfFactory
interface defines is a subclass of RixShadingPlugin
, and defines a shading plugin responsible for creating a RixBxdf
object from a shading context (RixShadingContext
) and the set of connected patterns (RixPattern
).
...
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 . 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.
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.
...