Physically-based BRDF
Introduction
Physically based rendering have been known for many years, but the "ad-hoc" rendering models (such as Phong) are still widely used in game. These "ad-hoc" models require laborious tweaking to produce high-quality images. However, physically based, energy-conserving rendering models easily create materials that hold up under a variety of lighting environments.
Surprisingly, physically based models are not more difficult to implement or evaluate than the traditional "ad-hoc" ones.
Reflectance equation
The most common used rendering model in game describes only reflectance, not including terms such as SSS. The reflectance equation is:
Here is BRDF,
is the contribution from light source,
is the angle between light and surface normal. This integration results the sum of all light sources contribute to a surface point.
Diffuse term
The simplest BRDF is the Lambert. The well-known Lambertian BRDF in game is present as . However, it is part of reflectance equation, and lambertian term is actually a constant value:
Punctual Light Sources
These are classic point, directional, and spot lights in compute games. These local light source can be abstracted to a concept named "punctual light sources". They are infinitely small light with centain direction. Since what we want is the lighting reach a surface point, we don't need to consider the attenuation. A punctual light source are parameterized by the light color and the light direction vector
. The light color
is specified as the color a white Lambertian surface would have when illuminated by the light from a direction parallel to the surface normal (
).
How to calculate the contribution from this light source to a point? Here we will start by defining a tiny area light source centered on , with a small angular extent
. This tiny area light illuminates a shaded surface point with the incoming radiance function
. The incoming radiance function has the following two properties:
The first property says that no light is incoming for any light directions which form an angle greater than with
. The second property follows from the definition of
. Since the surface is white,
. Applying reflectance equation and Lambert from last article, there's the second property. Because
requires
, it is the limit as
goes to 0:
Since and
, we can assume
, which gives us:
That is:
Now we shall apply our tiny area light to a general BRDF, and look at its behavior in the limit as goes to 0:
So
As you see, the tiny area light source term disappears. The remaining of our equation is what we familar with.