Page tree

Versions Compared

Key

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

...

A common – equally good – alternative is called "Shirley remapping".  It does not rely on 3D stratification.  Instead, get a 2D sample and first use one of the coordinates of the sample to select the sub-domain, and then map the sample within that selected domain (based on the probability) back to the unit square domain.  A figure provides a more intuitive explanation – in this example we choose between two light area sources, with 80% chance of selecting the first light and 20% chance of selecting the second

TO DO:  Figure of samples before and after remapping?  

Splitting

Splitting was mentioned above.

Intuition: 1 cam ray x 4 diff rays should give same diffuse directions as 4 cam rays x 1 diff ray.  Figure?

light: 

Image AddedImage AddedImage Added

Note how the middle image are the samples from the left 80% of the left image, only stretched a bit horizontally.  Likewise, the right image is the samples from the right 20% of the left image, but stretched 5x horizontally.  The stretching preserves the stratification properties of the original sample points.

This method of using 2D samples to both choose between sample sub-domains and at the same time stretching the samples from the chosen sub-domain to provide stratified 2D sample points is implemented in the RixChooseAndRemap() function in the RixShadingUtils.h include file.

Splitting

Path splitting and distribution ray tracing were mentioned above (in the description of the various NewDomain*() functions).  But when is it appropriate to use which?  A couple examples should provide some guidance:

Use path splitting if there is a known, fixed branching factor.  For example, if all camera ray hits spawn four direct illumination rays then NewDomainSplit() can correctly offset into the sample sequence so that all samples in the sequence are used exactly once.  This way, the direct illumination ray directions from all camera ray hit points for a given pixel combine into one well stratified sample pattern.

Resort to distribution ray tracing if there is no fixed branching factor.  For example, if some specular ray hit points spawn 16 new sample directions bu other specular ray hit points (perhaps with a lower throughput) only spawn 4 or even 1 new sample directions.  In this case there is no simple way to compute the offset into a combined sample sequence.  Instead the 16 (or 4) sample directions are stratified with respect to each other, but not with respect to any other samples for that same pixel.  (If only 1 new sample direction is spawned then there is no stratification at all.)TO DO?:  When to use splitting and when not.

Uniform random samples

Non-stratified samples similar to e.g. drand48() can be obtained by calling the HashToRandom() function.  It computes a repeatable random float between 0 and 1 given two unsigned int inputs, for example patternid and sampleid.  The function is repeatable (ie. the same two inputs always give the same output), and has no multi-threaded contention (whereas drand48() has notoriously bad locking, hampering multi-threaded performance).  HashToRandom() is located in the RixRNGInline.h include file.

...