i
i
i
i
i
i
i
i
256 7. Advanced Shading
Original Phong BRDF
Normalized Phong BRDF
m = 25
m = 50 m = 75 m = 100
Figure 7.38. Rendered images of a red plastic sphere. The bottom row of images was
rendered with the normalized Phong BRDF, using c
spec
=0.05 (an appropriate value for
plastic). The value of c
diff
was set to [0.95, 0, 0], for maximum saturation and brightness
without violating energy conservation. The top row of images was rendered with the
original (not normalized) Phong BRDF, using values of c
spec
and c
diff
chosen so that the
two leftmost images match. The value of the smoothness parameter m increases from
right to left, and the other BRDF parameters are held constant for each row. The intent
is to render spheres made of the same substance (red plastic) but of differing surface
smoothness. It can be seen that in the bottom row, the highlight grows much brighter
as it gets narrower, which is the correct behavior—the outgoing light is concentrated in
a narrower cone, so it is brighter. In the top row, the highlight remains equally bright
as it gets narrower, so there is a loss of energy and the surface appears to be getting less
reflective.
the original Phong BRDF do not have this property. The original Phong
BRDF could be used to render the same images as those in the bottom
row, but this would require carefully setting c
spec
to values that increase
with m—a highly unintuitive process. As discussed earlier, the authoring
problem becomes even worse if values for c
spec
and m are painted into
textures.
Normalized BRDFs yield the ability to intuitively control physically
meaningful parameters, enabling easy authoring of realistic materials. The
additional rendering cost over a non-normalized version of the same BRDF
is very low, so it is recommended to always use the normalized form. Note
that physically derived BRDFs do not require normalization, since they
have physical parameters by construction.
The normalized version of the Phong BRDF in Equation 7.47 is signifi-
cantly improved from the original form, but we can do better. The Phong
BRDF is reflection-vector-based, which (as noted in Section 7.5.7) is un-
desirable. Fortunately, a half-vector-based variant was proposed by Blinn
i
i
i
i
i
i
i
i
7.6. BRDF Models 257
in 1977 [97], commonly referred to as the Blinn-Phong BRDF. The BRDF
was originally presented in a non-normalized form, but a normalized form
was derived
16
by Sloan and Hoffman in 2008 [1191]:
f(l, v)=
c
diff
π
+
m +8
8π
c
spec
cos
m
θ
h
. (7.48)
Note that to get a similar highlight, the value of m used in the Blinn-Phong
BRDF should be about four times that used for the Phong BRDF [344].
The Blinn-Phong BRDF can also be cheaper to evaluate than the Phong
BRDF in some cases. If both vectors l and v are constant, h can be
computed once and reused. In addition, the computation of h requires
fewer operations than r
i
.
Besides the various benefits of half-vector-based BRDFs discussed in
Section 7.5.7, another advantage is that the form is similar to a microfacet
BRDF. This similarity means that the various expressions can be inter-
preted using microfacet theory. For example, the cosine power term can be
interpreted as a normal distribution function (NDF), which gives a clear
physical meaning to the cosine power m—it is a parameter of the micro-
geometry NDF. It is also clear that the BRDF can be extended to include
the Fresnel effect by simply replacing c
spec
with R
F
(α
h
). This modifica-
tion yields a BRDF that has physically meaningful parameters, models the
most important phenomena responsible for the visual appearance of most
materials, and has reasonably low computation and storage requirements:
f(l, v)=
c
diff
π
+
m +8
8π
R
F
(α
h
) cos
m
θ
h
. (7.49)
Note that after this modification, the energy conservation condition c
diff
+
c
spec
1 no longer applies, and care needs to be taken when setting pa-
rameters if energy conservation is desired. Alternatively, the model could
be further extended by replacing the Lambertian diffuse term with one of
the diffuse terms discussed in Section 7.5.4.
The BRDF in Equation 7.49 is often sufficient for most real-time ren-
dering needs. However, there are some phenomena it does not model,
and sometimes the need for a different BRDF will arise. For example,
the “cosine term raised to a power” NDF used in the Blinn-Phong BRDF
(sometimes called a Phong lobe) causes a certain falloff in intensity from
the center of the highlight to its periphery, and sometimes highlights with
a different “look” may be desired. The NDF directly controls the appear-
ance of the highlight, so the effects of changing it can be quite visible. It is
fairly straightforward to modify the Blinn-Phong BRDF by replacing the
cosine power NDF with a different one. The hardest part is computing a
new normalization factor for the specular term.
16
See http://www.realtimerendering.com/blinn-phong-normalization.pdf.
i
i
i
i
i
i
i
i
258 7. Advanced Shading
Various other isotropic NDFs have been proposed in the computer
graphics literature [97, 192, 193, 1270], but these are similar visually to the
cosine power NDF and are more expensive to compute.
17
Some materials
exhibit multiscale roughness (different roughnesses at different scales). This
results in NDF curves that appear to be combinations of simpler curves, for
example a low broad curve and a high narrow one. One simple way to im-
plement such NDFs is to use a sum of appropriately weighted Blinn-Phong
lobes.
Anisotropic NDFs can be used as well. Note that unlike isotropic NDFs,
anisotropic NDFs cannot be evaluated just with the angle θ
h
; additional
orientation information is needed. In the general case, the half vector h
needs to be transformed into the local frame defined by the normal, tangent
and bitangent vectors (see Figure 7.31 on page 248). The Ward [1326] and
Ashikhmin-Shirley [42, 43] BRDFs both include anisotropic NDFs that
could be reused in a modified Blinn-Phong BRDF.
18
A particularly interesting option is to “paint” an arbitrary highlight
shape into a bitmap for use as an NDF [632]. This is known as NDF map-
ping and allows for a variety of effects. If care is taken, the result can still
be a physically plausible BRDF [41, 46]. NDFs can also be drawn from vi-
sual inspection of the highlight shapes of real materials [44]. However, since
an NDF map is not a parametric representation, NDF mapping precludes
the texturing of NDF parameters, which is useful for modeling spatially
variant materials.
Pretty much any function over the hemisphere can be used as an NDF.
Usually NDFs are assumed to be normalized so that they integrate to 1
over the hemisphere, but this is not necessary for empirical BRDFs such
as Blinn-Phong, since the specular term needs to be renormalized after
incorporating a new NDF.
Some surfaces are not modeled well with a Blinn-Phong-style BRDF,
regardless of the NDF chosen. For example, extremely anisotropic surfaces
like brushed metal and hair are often best modeled as tightly packed one-
dimensional lines. Kajiya and Kay developed a simple BRDF model for this
case [620], which was given a solid theoretical foundation by Banks [57]. It
is alternately known as “the Kajiya-Kay BRDF” and “the Banks BRDF.”
The basic concept is based on the observation that a surface composed
of one-dimensional lines has an infinite number of normals at any given
location, defined by the normal plane perpendicular to the tangent vector t
at that location (t represents the direction of the grooves or fur [764]). The
17
It is interesting to note that Blinn [97] proposed the Trowbridge-Reitz NDF as a
replacement for the cosine power NDF because it was cheaper to compute. It was—in
1977. Changes in hardware have now made the cosine power NDF cheaper.
18
When implementing the Ward NDF, see the technical report by Walter [1316] that
includes a hardware-friendly form using only dot products.
i
i
i
i
i
i
i
i
7.6. BRDF Models 259
v
n
spec
l
n
diff
Figure 7.39. Shading normals used for the Kajiya-Kay model. A thin fiber is modeled
as a cylinder that has an infinite number of surface normals (shown by the light blue
circular plane) at each shaded point. On the left, the light vector l is projected onto the
normal plane, resulting in the vector n
diff
. This shading normal is used for computing
the light projection cosine factor
cos θ
i
. On the right, the view vector v is projected
onto the normal plane, resulting in the vector n
spec
. This shading normal is used for
computing the reflection vector r used in the specular BRDF term.
Kajiya-Kay BRDF is essentially identical to the original Phong BRDF once
a shading normal is selected out of this infinite set. Actually, two different
shading normals are used—the diffuse BRDF term uses the projection of
the light vector l onto the normal plane, and the specular term uses the
view vector v projected onto the normal plane (see Figure 7.39). One form
of these terms is [533, 628]
cos θ
i
=
1 (l · t)
2
,
cos α
r
=max
1 (l · t)
2
1 (v · t)
2
(l · t)(v · t), 0
,
(7.50)
where
cos θ
i
and cos α
r
are the equivalents of cos θ
i
and cos α
r
in the Phong
BRDF, but using the appropriate shading normal, rather than the geomet-
ric surface normal n. The surface normal n is not used, except to simulate
self-shadowing by setting the BRDF value to 0 when the angle between
l and n exceeds 90
. Although the Kajiya-Kay model was formulated in
terms of the original Phong BRDF, there is no reason that the substitutions
from Equation 7.50 could not be performed with the normalized version.
Presumably, an anisotropic version of the Blinn-Phong BRDF could be de-
rived using the same principles (most likely projecting the half vector h,
instead of v, onto the normal plane to find the specular shading normal).
It is interesting to interpret the differences between the modified Blinn-
Phong BRDF in Equation 7.49 and other empirical BRDFs in terms of the
full microfacet BRDF in Equation 7.43 (on page 249). To facilitate this
comparison, we will derive a version of the microfacet BRDF that uses a
cosine power NDF:
f(l, v)=
G(l, v)
cos θ
i
cos θ
o

m +2
8π
cos
m
θ
h
R
F
(α
h
). (7.51)
i
i
i
i
i
i
i
i
260 7. Advanced Shading
Equation 7.51 shows the microfacet BRDF grouped into logical terms. Here
is the specular term of the modified Blinn-Phong BRDF, grouped the same
way:
f(l, v)=
m +8
8π
cos
m
θ
h
R
F
(α
h
). (7.52)
The Fresnel term is identical in both BRDFs. Both BRDFs also have very
similar “NDF terms,” each including an exponentiated cosine and a nor-
malization constant. The small difference between the two normalization
constants is due to different assumptions in the normalization process. In
any case, the difference will be small for all but the roughest surfaces.
The most significant difference between the two BRDFs is the leftmost
term in the microfacet BRDF, which is completely missing in the Blinn-
Phong BRDF. This term includes the geometry factor divided by two cosine
factors. The geometry factor models shadowing and masking, and the
cosine factors in the denominator model the foreshortening of the surface
with respect to the light or camera. We will refer to the combined term as
the visibility term.
The modified Blinn-Phong BRDF has the simplest possible visibility
term, equal to a constant value of 1. This clearly has advantages in terms
of simplicity and evaluation cost—it is worth closer examination to see
if there are any disadvantages. A visibility term of 1 can be interpreted
to mean that the modified Blinn-Phong BRDF has an implicit geometry
factor:
G
BF
(l, v)=cos θ
i
cos θ
o
, (7.53)
which even makes some sense physically. Geometry factors simulate shad-
owing and masking effects and tend to decrease at glancing angles. The
implicit geometry factor shown in Equation 7.53 does exhibit this behavior.
However, this decrease happens rapidly as the light or view vector diverges
from the surface normal, and it can be shown that this causes the Blinn-
Phong BRDF to appear dark at glancing angles compared to real surfaces,
particularly smooth metals [925]. For many applications, this will not be
a concern. If it is, then there are several visibility terms proposed in the
graphics literature that can be used to mitigate this problem. Since they
will be more expensive to compute than the empty visibility term of the
modified Blinn-Phong BRDF, they are worth adopting only if they result
in some desired visible change.
The visibility term of the Ward BRDF is equal to 1/(
cos θ
i
cos θ
o
),
19
ef-
fectively omitting the geometry factor and ignoring the effects of shadowing
and masking [1326]. The Ward BRDF also does not include a Fresnel term
19
Note that the Ward BRDF was originally presented with a different visibility
term [1326], but it was changed to 1/(
cos θ
i
cos θ
o
) in a later correction by ur [280].
This correction has also been adopted by Ward, making it official.
..................Content has been hidden....................

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