i
i
i
i
i
i
i
i
7.5. BRDF Theory 231
n
n
1
n
2
L
l
t
-n
[R
F
(θ
i
)]L
[1-R
F
(θ
i
)]
sin
2
θ
i
L
sin
2
θ
t
n
n
.
l
2(n
.
l)n
-l
l
r
i
r
i
Figure 7.18. Reflection and refraction at a planar surface. The left side shows the indices
of refraction n
1
and n
2
of the two substances, as well as the radiance and direction of
the incoming, reflected, and refracted rays. The right side shows how the light vector
l is reflected around the normal n in order to generate r
i
.First,l is projected onto n,
and we get a scaled version of the normal: (n ·l)n.Thenl is negated, and if we add two
times the projected vector, the reflection vector is obtained: r
i
=2(n · l)n l.
The right side of Figure 7.18 shows a geometrical construction that explains
Equation 7.30.
Both the Fresnel reflectance R
F
and the transmission angle θ
t
depend
not only on the incoming angle θ
i
, but also on an optical property of the two
substances called the refractive index or index of refraction.Thesymboln is
commonly used to denote refractive index. In this case n
1
is the refractive
index of the substance “above” the interface (where the light is initially
propagating) and n
2
is the refractive index of the substance “below” the
interface (where the refracted light propagates). The dependence of θ
t
on
θ
i
, n
1
,andn
2
obeys a simple equation, known as Snell’s Law:
n
1
sin(θ
i
)=n
2
sin(θ
t
). (7.31)
The vector t is used in global refraction effects, which are outside the scope
of this chapter; the use of Snell’s Law to efficiently compute t will be shown
in Section 9.5.
Snell’s Law combined with Equation 7.29 yields a different form for
transmitted radiance:
L
t
=(1 R
F
(θ
i
))
n
2
2
n
2
1
L
i
. (7.32)
The Fresnel equations describe the dependence of R
F
on θ
i
, n
1
,and
n
2
. Rather than present the equations themselves (which are quite com-
plicated), we will describe their important characteristics.
8
8
The equations can be found in any optics textbook—a good introductory text is
Introduction to Modern Optics by Fowles [361].
i
i
i
i
i
i
i
i
232 7. Advanced Shading
External Reflection
External reflection is the case where light reflects from an object’s exter-
nal surface; in other words, light is in transition from air to the object’s
substance (the opposite transition, from object to air, is called internal
reection and is discussed later).
For a given substance, the Fresnel equations can be interpreted as defin-
ing a reflectance function R
F
(θ
i
), dependent only on incoming light angle.
In principle, the value of R
F
(θ
i
) varies continuously over the visible spec-
trum. For rendering purposes its value is treated as an RGB vector. The
function R
F
(θ
i
) has the following characteristics:
When θ
i
=0
(light perpendicular to the surface, or l = n) R
F
(θ
i
)
has a value that is a property of the substance. This value, R
F
(0
),
can be thought of as the characteristic specular color of the substance.
The case when θ
i
=0
is sometimes called normal incidence,
As θ
i
increases (the surface is viewed at increasingly glancing angles),
the value of R
F
(θ
i
) will tend to increase, reaching a value of 1 for all
frequencies (white) at θ
i
=90
.
Figure 7.19 shows R
F
(θ
i
) curves for external reflection from a variety
of substances. The curves are highly nonlinear—they barely change until
θ
i
=60
or so, and then quickly go to 1. The increase from R
F
(0
)to1is
mostly monotonic, though some of the substances (most notably aluminum)
do show a slight dip just before going to white.
This increase in reflectance at glancing angles is sometimes called the
Fresnel effect in rendering.
9
You can see the Fresnel effect for yourself
with a short experiment. Take a plastic CD case and sit in front of a
bright area like a computer monitor. First hold the CD case close to your
chest, look down at it, and angle it slightly so that it reflects the monitor.
There should be a relatively weak reflection of the monitor on the plastic,
and the CD or cover image should be clearly visible under it. This is
because the characteristic, normal-incidence reflectance of plastic is quite
low. Now raise the CD case up so that it is roughly between your eyes and
the monitor, and again angle it to reflect the monitor. Now the reflection
of the monitor should be much stronger, obscuring whatever is under the
plastic.
Besides their complexity, the Fresnel equations have other properties
that makes their direct use in rendering difficult. They require (possibly
complex) refractive index values sampled over the visible spectrum. The
equations are evaluated for all the sampled frequencies and converted into
RGB values using the methods detailed in Section 7.3.
9
Outside rendering, the term has a different meaning relating to transmission of radio
waves.
i
i
i
i
i
i
i
i
7.5. BRDF Theory 233
0
1
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0 102030405060708090
R
F
diamond
copper
aluminum
iron
glass
water
Figure 7.19. Fresnel reflectance for external reflection from a variety of substances.
Since copper and aluminum have significant variation in their reflectance over the visible
spectrum, their reflectance is shown as three separate curves for R, G, and B. Copper’s
R curve is highest, followed by G, and finally B (thus its reddish color). Aluminum’s B
curve is highest, followed by G, and finally R. Aluminum has a faint bluish tint that is
most noticeable at an incidence angle of about 80
.
The curves in Figure 7.19 suggest a simpler approach based on the
characteristic specular color R
F
(0
). Schlick [1128] gives an approximation
of Fresnel reflectance that is fairly accurate for most substances:
R
F
(θ
i
) R
F
(0
)+(1R
F
(0
))(1 cos θ
i
)
5
. (7.33)
This is a simple RGB interpolation between white and R
F
(0
). Despite
this, the approximation is reasonably accurate for most materials, as can
be seen in Figure 7.20. Sometimes this equation is modified in practice to
raise the final term to powers other than 5 (4, or even 2). Although this
may reduce accuracy, it is sometimes done for artistic reasons (to modify
the material appearance) or for performance reasons (to simplify the pixel
shader). The Schlick approximation performs less well with substances that
exhibit a noticeable “dip” just before going to white, such as aluminum and
iron. If it is important to precisely capture the color shifts of such materials,
i
i
i
i
i
i
i
i
234 7. Advanced Shading
0
0.2
0.4
0.6
0.8
0 102030405060708090
angle of incidence θ
i
R
F
0
0.2
0.4
0.6
0.8
diamond
copper
aluminum
iron
glass
water
Figure 7.20. Schlick’s approximation to Fresnel reflectance compared to the correct values
for external reflection from a variety of substances (separated into two graphs for clarity).
The solid lines were computed from the full Fresnel equations (in the case of copper and
aluminum, this computation was performed at a dense sampling of frequencies and the
resulting spectral distribution was converted to RGB values). The dotted lines are the
result of Schlick’s approximation (computed separately for R, G, and B in the case of
copper and aluminum).
a good course of action may be to precompute R
F
(θ
i
) values for various
angles into a one-dimensional lookup texture.
When using the Schlick approximation, R
F
(0
) is the only parameter
that controls Fresnel reflectance. This is convenient since R
F
(0
) has a well-
defined range of valid values (between 0 and 1), is easy to set with standard
color-picking interfaces, and can be textured using texture formats designed
for colors. In addition, reference values for R
F
(0
) are available for many
real-world materials. The refractive index can also be used to compute
R
F
(0
). It is common to assume that n
1
= 1 (a close approximation
for the refractive index of air), and to simply use n instead of n
2
for the
refractive index of the object. This gives the following equation:
R
F
(0
)=
n 1
n +1
2
. (7.34)
i
i
i
i
i
i
i
i
7.5. BRDF Theory 235
This equation works even with complex-valued refractive indices if the mag-
nitude of the (complex) result is used. Note that if the refractive indices
vary significantly over the visible spectrum, the spectral distribution of
R
F
(0
) needs to be computed and converted into an RGB vector using the
methods described in Section 7.3.
Typical Fresnel Reflectance Values
Different types of substances will have different ranges of values for R
F
(0
).
Substances are divided into three main groups with respect to their optical
properties: insulators (also called dielectrics); metals (conductors); and
semiconductors, which have properties somewhere in between the first two
groups. Since semiconductors are rarely found in rendered scenes, we will
not discuss them further and will focus on insulators and metals.
Most commonly encountered materials are insulators—water,
10
glass,
skin, wood, hair, leather, plastic, stone, concrete, etc. Insulators have
fairly low values for R
F
(0
)—usually 0.05 or lower. This low reflectance
at normal incidence makes the Fresnel effect particularly visible for insula-
tors. The optical properties of insulators rarely vary much over the visible
spectrum, resulting in colorless reflectance values. The R
F
(0
) values for
several common insulators are shown in Table 7.3, which includes RGB
values in both linear and sRGB space.
11
The R
F
(0
) values for other in-
sulators can be inferred by looking at similar substances in the table. For
unknown insulators, 0.05 is a good default working value. Most substances
of biological origin are close to this value, as well as many others.
Once the light is transmitted into the insulating substance, it may be
further scattered or absorbed. This process is discussed in more detail in
Section 7.5.4. If the material is transparent, the light will continue until
it hits an object surface “from the inside,” which is detailed later under
“Internal Reflection.”
Metals have high values of R
F
(0
)—almost always 0.5orabove.Some
metals have optical properties that vary over the visible spectrum, resulting
in colored reflectance values. The R
F
(0
) values for several common metals
are shown in Table 7.4. The R
F
(0
) values for other metals can be inferred
by looking at similar substances in the table.
10
Pure water has very low conductivity, although most water encountered outside
the laboratory has numerous impurities that cause it to become conductive. These
are usually not present in sufficient quantities to significantly alter the water’s optical
properties.
11
When colors such as R
F
(0
) are set in digital content creation applications, it is
often convenient to author them in a nonlinear display space such as sRGB and convert
them to linear space before use. This ensures that the colors seen in the color-selection
interface match the colors seen when shading. If such colors are stored in textures,
encoding them nonlinearly also helps maximize bit precision (see Section 5.8 for details).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset