15
$\begingroup$

Looking at a light probe texture, it looks like a blurry environment map.

What's the difference between the two, how is a light probe made, and what is the benefit of it being blurry?

$\endgroup$
  • 3
    $\begingroup$ Short answer: "light probes" usually means a compact spherical harmonic representation of the environment. They're blurry both because they're very compact (only a few tens of bytes storage) and because they're prefiltered for use as diffuse lighting. I'll expand into a longer answer when I have a chance. :) $\endgroup$ – Nathan Reed Aug 13 '15 at 6:18
  • $\begingroup$ Is there any context for your question? The term 'light probe' is ambigious and used differently in different scenarios, algorithms and engines. $\endgroup$ – David Kuri Aug 13 '15 at 12:07
  • $\begingroup$ Specifically, if you have been to shadertoy.com you'll see two sets of cube maps available for use. One set is environment maps, the other set looks the same but blurry that are labeled light probes. Just curious about that and light probes in general. $\endgroup$ – Alan Wolfe Aug 13 '15 at 14:49
16
$\begingroup$

There are two different common meanings of "light probe" that I'm aware of. Both of them represent the light around a single point in a scene, i.e. what you would see around you in all directions if you were shrunk down to a tiny size and stood at that point.

One meaning is a spherical harmonic representation of the light around a point. Spherical harmonics are a collection of functions defined over a spherical domain, which are analogous to sine waves that oscillate a certain number of times around the equator and from pole to pole on the sphere.

Spherical harmonics can be used to create a smooth, low-res approximation of any spherical function, by scaling and adding together some number of spherical harmonics—usually 4 (known as linear, first-degree, or one-band SH) or 9 (called quadratic, second-degree, or two-band SH). This is very compact because you only have to store the scaling factors. For instance, for quadratic SH with RGB data, you only need 9*3 = 27 values per probe. So SH makes a very compact, but also necessarily very soft and blurry, representation of the light around a point. This is suitable for diffuse lighting, and perhaps specular with a high roughness.

This screenshot from Simon's Tech Blog shows an array of SH light probes spaced throughout a scene, each one showing the indirect lighting received at that point:

SH light probe array

The other currently common meaning of "light probe" is an environment cube-map whose mip levels have been pre-blurred to different extends so it can be used for specular lighting with varying levels of roughness. This image from Seb Lagarde's blog shows the basic idea:

Prefiltered cubemap mip levels

The higher-resolution mips (toward the left) are used for highly polished surfaces where you need a detailed reflected image. Toward the right, the lower-res mip levels are increasingly blurred, and are used for reflections from rougher surfaces. In a shader, when sampling this cubemap, you can calculate your requested mip level based on the material roughness, and take advantage of the trilinear filtering hardware.

Both of these types of light probes are used in real-time graphics to approximate indirect lighting. While direct lighting can be calculated in real-time (or at least approximated well for area lights), indirect lighting is usually still baked in an offline preprocess due to its complexity and computational overhead.

Traditionally, the result of the baking process would be lightmaps, but lightmaps only work for diffuse lighting on static geometry, and they take up a lot of memory besides. Baking a bunch of SH light probes (you can afford a lot of them because they're very compact), plus a sparser sprinkling of cubemap light probes, allows you to get decent diffuse and specular indirect lighting on both static and dynamic objects. They're a popular option in games today.

$\endgroup$
  • $\begingroup$ Great explanation! Just to confirm about the part about using trilinear filtering on the mips... Mips are preferred over volume textures because they use less resolution, and higher Blur levels need less resolution? $\endgroup$ – Alan Wolfe Aug 14 '15 at 5:37
  • 1
    $\begingroup$ I'd say that both these "kinds" of light probes are the same. Light probes are a measure of the radiance (usually pre-convoluted in some way) received at a point in the scene. Cubemaps and SH are just different ways to store/compute a light probe, making different storage/perf/quality trade-offs. (EDIT: Just to make it clear, I agree with the answer, I just think it's counter-productive to think of them as separate things.) $\endgroup$ – yuriks Aug 14 '15 at 5:39
  • $\begingroup$ @AlanWolfe There is a use and that is to have maps for diffuse ligtning taken from a real environment (called gray ball/white ball), not just specular. Heres a disucssion of both Mirror/Gray Ball Shaders $\endgroup$ – joojaa Aug 14 '15 at 11:04
  • 1
    $\begingroup$ @AlanWolfe Correct—you need less resolution on the more blurred levels. Also, cubemap volume textures aren't a thing that exists in hardware. :) $\endgroup$ – Nathan Reed Aug 14 '15 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.