Page tree

Versions Compared

Key

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

...

The RIX_BXDFPLUGINCREATE() macro defines the CreateRixBxdfFactory() method, which is called by the renderer to create an instance of the bxdf plugin. Generally, the implementation of this method should simply return a new allocated copy of your bxdf factory class. Similarly, the RIX_BXDFPLUGINDESTROY() macro defines the DestroyRixBxdfFactory()  method  function called by the renderer to delete an instance of the bxdf plugin; a typical implementation of this method function is to delete the passed in bxdf pointer:

Code Block
languagecpp
    RIX_BXDFPLUGINCREATE
    {
        return new MyBxdfFactory();
    }
    RIX_BXDFPLUGINDESTROY
    {
        delete ((MyBxdfFactory*)bxdf);
    }

RixBxdfFactory::BeginScatter()

...

Once a RixBxdf object is obtained, the integrator may invoke the following methods:

  • RixBxdf::GetEvaluateDomain() to figure out the domain over which the Bxdf evaluate samples;
  • 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 transportTrait tells the Bxdf the subset of light transport to consider: direct illumination, indirect illumination, or both. 
  • lobesWanted specifies what lobes are requested, for example specular reflection, diffuse transmission, etc. 
  • rng should be called to generate well-stratified samples; such samples typically reduce noise and improve convergence compared to using uniform random samples. 

...

The EvaluateSamplesAtIndex() function is very similar to EvaluateSample(), but is used to evaluate multiple samples at the same surface position and normal, but with different illumination directions (Ln). The inputs are the same as for EvaluateSample(), except that it has two additional inputs: index and number of samples numSamples. index is used to index into built-in variables such as the normal Nn and viewing direction Vn, and numSamples is the number of directions (Ln) to evaluate the bxdf for. The functionality of EvaluateSamplesAtIndex() otherwise is similar to EvaluateSample()and exists in order to make sample evaluation more efficient in certain light transport settings.

RixOpacity

The renderer will invoke the following methods on RixOpacity:

  • RixBxdf::GetPresence() to evaluate the geometry presence.
  • RixBxdf::GetOpacity() to evaluate the opacity color.

Installation

RenderMan will search for bxdf plugins on demand, under the rixplugin searchpath. The following rib stream will search for a plugin file named MyDiffuse.so

Code Block
Bxdf "MyDiffuse" "diffuse1" "color tint" [0.5 0.5 0.5]

Creating a Bxdf args File

...

Evaluation Domain

Bxdfs can help integrators converge more quickly by providing hints about the domain over which they need to be integrated (the full domain being the entire sphere). This is done by the bxdf implementing a RixBxdf::GetEvaluateDomain() function that returns the appropriate RixBXEvaluateDomain value. For more information, please see Bxdf Evaluation Domain.


RixOpacity

The renderer will invoke the following methods on RixOpacity:

  • RixBxdf::GetPresence() to evaluate the geometry presence.
  • RixBxdf::GetOpacity() to evaluate the opacity color.


...

Additional Considerations

...