Graphics Reference
In-Depth Information
and
v o into a new coordinate frame in which the surface normal at P is the second
basis vector, and then apply f to these transformed vectors. Similarly, we might
want to use f to represent a surface that's “blotchy”—it's more reflective in some
places than others. We can do so by varying the value k as we move across the
surface. The code for f s then has the structure shown in Listing 14.5.
Listing 14.5: Evaluating f s via a basic function f .
1
2
3
4
5
6
fs(P, wi, wo)
k = getReflectivity(P)
b 1 , b 2 , b 3 = getBasis(P)
wiLocal = wi written in the b basis
woLocal = wo written in the b basis
return f(k, wiLocal, woLocal)
Most objects have varying appearance over their surface, like our blotchy
sphere does. That is to say, f s varies over the surface of objects, not only because
of the orientation of the surface, but because of varying surface properties. But
the variation usually happens in the form just described: Some tool like texture
mapping is used to determine the variation in the parameters that we want to pass
to the basic scattering function f .
It would be awkward to work with a program in which there was actually
a single BSDF for the entire scene that took a scene point as an argument and
chose parameters based on it. For modularity, we want to have different BSDFs
and attach them to surfaces freely. That is, “BSDF” should be a programmatic
interface (i.e., type), and specific BSDFs such as those for glass and wood can
be implementations of that interface. The spatial variation within a single logical
material still presents a problem. That variation is typically parameterized in the
surface's own reference frame since the variation should transformwith the object,
appearing “painted on” the surface rather than projected through space onto it.
Two natural choices present themselves. One choice is to represent the BSDF
for a single, small patch that is itself homogeneous. This pushes the problem of
finding the local parameter variation back into the part of the program that sampled
the surface location; for example, the ray-casting engine. In this case, we have
fs(wi, wo) as the BSDF evaluation function.
The other choice is to represent the BSDF for an entire material with
spatial variation and explicitly specify the point to be sampled in the mate-
rial's own space ; for example, using texture coordinates. In this case, we have
fs(u, v, wi, wo) as the BSDF evaluation function (although perhaps, since it's
a different function, we should use a name other than fs for it).
Neither choice is obviously superior; which to use depends on the constraints
and design of the surface-sampling machinery. A similar choice can be made for
the space in which to express the direction vectors. Thus far, we've followed the
mathematical convention of assuming that
v o are in world space. However,
the BSDF model is usually derived in the surface's tangent space. Expressing the
arguments in world space thus forces the BSDF to transform the arguments into
the tangent space. That transformation may be explicit, or it may be implicit by
developing all terms as dot products with the tangent and normal vectors. This
also forces our “BSDF” representation to be aware of the local orientation of the
surface—to be instantiated anew every time a point is sampled from the scene.
v i and
 
Search WWH ::




Custom Search