RixLighting

RixLighting

RixLightingServices

RIS usage: when RixLightingServices is obtained via RixIntegratorCtx

For Unidirectional integrators:

Begin(shadingCtx, ...)  // for direct lighting to RixShadingContext
GenerateSamples()
EvaluateSamples()
End()

For Bidirectional integrators:

BeginEmission() // for "photon" generation
GenerateEmission()
End()

Begin(shadingCtx)  // for direct lighting to RixShadingContext
GenerateSamples()
EvaluateSamples()
End()

Random Number Contexts

When creating an RNG for use by GenerateSamples, either pass the inherited (passed-in) RNG or make a new one with NewDomain(), selecting ONE sample. The LightingServices implementation will derive the appropriate number of samples from it internally.

Fixed Sample Count Lights

Individual lights may be configured to have a fixed sample count in which case their sample budget is fixed and not statistically chosen from the global count. In order to support this, k_RespectFixedSampleCount should be passed to the Begin() method. In addition, caller must provide a handle into which we return the total required number of fixed samples.

Subsequent lighting services calls should be invoked with at least that number of samples in order for the fixed sample count requests to be satisfied. If the number of samples is smaller that the fixed sample requirement then we fall back to statistical (globally-budgeted) sampling.

In order for MIS weights to be correctly computed, the evaluation of material samples needs to be aware of whether fixed sample counts were satisfied or not. This guarantee is provided to Begin(). Passing k_IgnoreFixedSampleCount permits sample counts to be tailored down as the trace depth increases.

  • Note:

    Passing k_RespectFixedSampleCount to the BeginEmission() method does not dictate sample counts but rather indicates that the count would have/will be respected for the GenerateSamples calls that will be made in subsequent Begin(RixShadingContext)/End() pairs. The information returned by BeginEmission() indicates the fixed sampling requests to expect for subsequent non-global Begin()s, and is not an indication to pass at least that many samples to GenerateEmission().

Bidirectional Variants

Two versions of GenerateSamples() and EvaluateSamples() are provided. One has additional outputs and will compute pdfs and other entities relevant for bidirectional transport. To use them, the integrator must specify bidirectional requirements when it configures itself.

GenerateSamples can trigger evaluation of the Bxdf. Optional arguments can be provided for GenerateSamples() that match those traditionally passed to RixBxdf::EvaluateSample(). When provided, we take over the task of invoking the Bxdf to evaluate the light samples and will pass back the same results that would have been handled by a loop over Bxdf::EvaluateSample(). By doing so, the per-lightsample Bxdf weights can be known by LightingServices. This information can be used to reduce the shadowing computations, so it is strongly advisable that integrators allow LightingServices to perform the Bxdf evaluation. This behavior is requested by passing non-NULL values for these parameters:

evaluatedMaterialWeights
evaluatedMaterialFPdf
evaluatedMaterialRPdf (for bidirectional)
lobesEvaluated

The evaluatedMaterial arrays must have space for nsamplesnpoints, while the lobesWanted array should contain space for npoints values.