Sampling a Light Probe Image to a Light Source List
This tutorial explains how to sample a lighting environment image (eg light probe)
into a chosen number of representative light sources using an area subdivision approach.
Choice of areas and light source positions and intensities are computed based on the
distribution of energy in parts of the image. In this way, the light source position
and intensity most representative of each particular area is obtained. This is useful
in rendering lighting environments where efficiency is paramount and a good approximation
to the full resolution environment will suffice.
The first thing to do is to make sure that the light probe image is already in the
correct panoramic format, in this case we require it to be in lat-long format. See
this tutorial for how to convert images between different
panoramic formats. Now we need to run the sampling algorithm on the lat-long image.
Activate the dialog via the menu 'Image->Spherical Transformations->Sample Light Probe
Image to Light Source List'.
Here's what the various dialog parameters mean:
Integer value that specifies how many light sources to sample the image into.
The output will contain 2 raised to the power of Depth sources
Correct for vertical falloff:
The pixels in a rectangular lat-long image are progressively over-represented towards
the top & bottom of the image, because the pixels have been stretched to get them to
fit into a rectangle. In order to compensate for this, the image should be pre-corrected
by a vertical falloff factor which darkens the pixels near the top and bottom edges
according to the cosine of the pixel y-value in the spherical domain. This parameter is
checked by default as we presume the image has not been pre-corrected for this effect.
Create output lights image:
The basic output of the procedure is a text file listing the sampled light source
information. The user can also choose to generate an output image with the same size as
the input, and showing the light source positions and intensities as single pixels
Create image showing computed cuts:
The user can also choose to generate another output image which shows the sampled
rectangular areas that were chosen as a 2D graph.
Output file format/Light position format:
The user can choose to have the output light source positions and intensities in one of
a straightforward text format, Maya MEL script, or PBRT script. Further, if the plain text
output is selected, then the light source positions can be given in spherical coordinates
in radians or degrees, or as unit XYZ vectors on the sphere.
Here the user can choose the sampling method to use -
Variance Minimization is the default and recommended sampling algorithm. It works by recursively
subdividing the current rectangular area into 2 areas with the partition point being chosen on
the basis of the energy variance between the 2 candidate regions. After recursion, the light source
position for each leaf rectangle is computed from the centroid of the rectangle. This work was
presented as a poster at ACM SIGGRAPH 2009.
The Median Cut algorithm is also included for comparison. This approach again recursively subdivides
the current rectangle into 2 areas, but this time the partition point is chosen based on the
absolute distribution of energy between 2 candidate regions. Leaf node light position and intensity
is computed as the mass centroid of the node region. For more details, see Ch. 9 (pp. 430-433)
"Image-Based Lighting" by Reinhard, Ward, Pattanaik, and Debevec, in High Dynamic Range Imaging:
Acquistion, Display, and Image-Based Lighting published by Morgan-Kaufmann, 2005.
Now, let's load up an image and look at the output generated by sampling using the variance
minimization technique. We use the familiar 'Grace Cathedral' High-Dynamic Range light probe
image, already represented as a lat-long image:
We then sample the image into 64 representative light sources:
For this example we have obtained both
the light source and 2D graph output images and made a visualization of a combination of all three
in order to show the placement and color of all available outputs. Note how the sample positions
correspond to the most representative position in each rectangular area in terms of energy