Page tree

Versions Compared

Key

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

...

Note that at the time of CreateInstanceData, like other shading plugins, Bxdfs are unable to inspect the values of pattern network inputs; therefore, in cases these inputs are provided (i.e: RixParameterList::GetParamInfo() returns k_RixSCNetworkValue) the Bxdf may have no choice but to defer inspection of the inputs until BeginOpacity() or BeginInterior(). At that time, those methods may then choose to return NULL instead.

...

  • RixBxdf::GenerateSample() to generate samples of the bxdf function, one sample for each point of the shading context.;
  • RixBxdf::EvaluateSample() to evaluate the bxdf function, one direction for each point of the shading context;
  • RixBxdf::EvaluateSamplesAtIndex() to evaluate the bxdf function, one-or-many directions for a given point of the shading context;
  • RixBxdf::EmitLocal() to retrieve the bxdf's local emission.

...

The RixBxdf methods above are expected to return quantities for each point of the shading context originally given to RixBxdfFactorRixBxdfFactory::BeginScatter(), excepting RixBxdf::EvaluateSamplesAtIndex(), that operates on a single point of the shading context, evaluating the bxdf function for one or many directions.

The GenerateSample() function has the following input parameters: transportTrait, lobesWanted, and random number generator. The transportTrait tells the Bxdf the subset of light transport to consider: direct illumination, indirect illumination, or both. lobesWanted specifies what lobes are  are requested, for example specular reflection, diffuse transmission, etc. The random number generator should be called to generate well-stratified samples; such samples typically reduce noise and improve convergence compared to using uniform random samples.

The GenerateSample() function has the following output parameters (results): lobeSampled, direction, weight, forward pdf, reverse pdf, and compTrans.  lobeSampled is similar to the input lobesWanted, and specifies which lobe was  was actually sampled. direction (Ln) is the generated ray direction vectors; these directions must have unit length. weight is a color per sample indicating that sample's weight. The forward pdf should account for light moving from the L to V direction where as the reverse pdf account for the opposite (from V to L). Bxdfs should always provide both pdf values for the integrators to use. compTrans is an optional result which can be used to indicate transmission color; this will be used as alpha in compositing. A bxdf should check that compTrans is not NULL before assigning to it.  All results are arrays with one value per sample point.

...

In order to maintain physical correctness, bxdfs are expected to conserve energy and obey the Helmholtz reciprocity. Care should be taken so that RixBxdf::GenerateSample(),   RixBxdf::EvaluateSample() and RixBxdf::EvaluateSamplesAtIndex() return consistent results. This allows bxdf plugins to be compatible with different rendering techniques such as:

...