Page tree

Versions Compared

Key

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

...

The context for a per-thread execution is signaled by the various methods Begin___() and End___(). Has As a consequence, RixBxdf objects can be assumed as being used used in a monosingle-threaded context.

The RixBxdfFactory should stash state in the RixBxdf object and consider that the RixBxdf lifetime is under control of the integrator. Generally integrators will attempt to minimize the number of live  RixBxdf  objects but may nonetheless require a large number. For this reason, the  RixBxdf  instances should attempt to minimize  memory consumption and construction / deconstruction costs.

...

  • RixBxdf::GenerateSample() generates one sample for each point of the shading context
  • RixBxdf::EvaluateSample() evaluates one direction for each point of the shading context
  • RixBxdf::EvaluateSamplesAtIndex()  evaluates one-or-many directions for a given point of the shading context

Bxdf parameters and correctness

A bxdf should always provide the three methods RixBxdf::GenerateSample()RixBxdf::EvaluateSample() and RixBxdf::EvaluateSamplesAtIndex().

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:

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 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 compared to using uniform random samples.

The GenerateSample() function has the following output parameters (results): lobeSampled, Ln, weight, forward pdf, reverse pdf, and compTrans.  lobeSampled is similar to the input lobesWanted, and specifies which lobe was actually sampled. Ln is the generated direction vectors; these directions must have unit length. Weight is a color per sample indicating that sample's weight. Note that the RixBxdf interfaces requires two separate scalar pdf values to be returned. 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. All results are arrays with one value per sample.

As an example, a purely Lambertian diffuse bxdf should ... Ln is cosine distribution over hemisphere ... weight is albedo ... forward pdf ... reverse pdf ...

Bxdfs that do not scatter light (e.g. PxrConstant) should disable all lobes and set the forward pdf and reversed reverse pdf to zero.

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:

Additional Considerations

Bxdf Evaluation Domain

Bxdf Lobes

Non-Opaque Surfaces

Alpha For for Compositing

Query Ray Properties

...