Graphics Reference
In-Depth Information
intersection fast and robust? Does your representation of luminaires make it easy
to select points on a luminaire uniformly with respect to area?
Inline Exercise 32.1: For each of the questions above, describe how a basic
ray tracer's output or running time might be affected by the answer being “Yes”
or “No.”
Beyond these choices, there are the practical matters of modeling. For
instance, the scattering properties of a surface are usually defined or measured
relative to the surface normal (and perhaps relative to a tangent basis as well),
while we've treated the scattering model (or at least the bidirectional scattering
distribution function or BSDF) as a function of a point in space and two direction
vectors. In practice, of course, we trace a ray to find a point of some surface, and
then find the BSDF at that point as a surface property, with its parameters being
determined both by surface position and by various texture maps. We'll begin by
discussing this particular simplification.
u
n
v
a
32.3 Surface Representations and
Representing BSDFs Locally
c
v
b
Consider a patch of surface so small that it may locally be considered flat, and
a local coordinate frame at a point P , with unit normal vector n and unit tangent
vectors u and v such that u , v , n is an orthonormal basis of 3-space, as shown in
Figure 32.1. This decomposition of a surface into a tangent space and a normal
space depends on local flatness; it's problematic at edges and corners (like those
of a cube), where it's not obvious which directions should be called “tangent”
or “normal.” This is a real problem for which graphics has yet to determine a
definitive answer.
Figure 32.1: A local basis at a
point P, consisting of mutually
perpendicular unit vectors. The
vector
is shown being decom-
posed into a linear combination
of these via dot products.
v
For any vector
at P , we can easily represent
= a u + b v + c n , by comput-
v
v
ing dot products: a =
v ·
u ,etc.
Inline Exercise 32.2: If
, n , u , and v are expressed in world coordinates, and
v
a
b
c
.
M is a 3
×
3 matrix whose rows are u , v , and n , then show that M
=
v
Knowing this lets us convert from world coordinates to local tangent-plus-
normal coordinates.
v o ) , which is a function of a surface point
and two (unit) vectors at that point. If we write
Consider now the BSDF f s ( P ,
v i ,
v i = a u + b v + c n and
v o =
a u + b v + c n , we can define a new function,
f s ( P , a , b , c , a , b , c )= f s ( P ,
v i ,
v o ) .
(32.1)
We can go further, however. Since
v i and
v o are unit vectors, we can express them
in polar coordinates using
φ
for longitude and
θ
for latitude, corresponding to the
=cos 1 ( b ) and
standard use of
θ
for the angle between
and n . This gives
θ
v
φ
= atan2 ( c , a ) , and we can write
 
 
 
Search WWH ::




Custom Search