Graphics Reference
In-Depth Information
the pixel square on the film plane) is constant. We're therefore treating the limit
of a constant as zero. Adjust all the renderers in this chapter to make an extra pass
to “correctly” render the effect of point lights by tracing a ray from each point
light to the eye, and adding the appropriate radiance to the appropriate pixel if the
point light's actually visible. In doing this, you're basically doing a special case
of bidirectional path tracing.
Exercise 32.9: In the ray-trace-with-photon-mapping renderer, we estimate
the direct light arriving from an area light with several samples. If the area light's
far away, this is probably overkill; if it's nearby, it's probably inadequate. For
Lambertian reflectance of a uniformly emitting planar, one-sided area light, only
the cosine term varies with the light-sample position. Suppose (see Figure 32.21)
that the area light is completely contained in a sphere of radius s about some
point Q , we're reflecting it at a point P of some Lambertian surface, the “bright
side” is completely visible from P , and the length of the vector r = Q
r
Luminaire
d
Transparent surface
P
P from
P to Q is d . Under what conditions on d and s can we approximate the reflected
radiance due to the luminaire directly multiplying the projected area (orthogonal
to r ) of the source, the cosine of the angle
Figure 32.21: The rule of five,
revisited.
θ
between r and n P and the Lamber-
tian reflectance, and 1
2 and be certain the result is correct within 1%? The
several assumptions—that the source be planar, uniform, completely visible, etc.,
and that the reflecting surface be Lambertian—are not really as restrictive as they
might sound. In particular, the same idea works for convex nonplanar sources,
although the computation of the projected area may be nearly as complex as using
multiple samples to estimate the reflected radiance.
(b) Suppose that the reflecting surface has a BRDF (for a fixed outgoing direc-
tion) whose variation, as a function of the incoming light direction
/
r
θ
, is nicely
θ )
|θ − θ |
bounded, that is,
|
f (
θ
)
f (
| <
K
. Can you do an analogous analysis?
See also Exercise 26.12 in Chapter 26.
Exercise 32.10: When we sampled points on an area light, we sampled uni-
formly with respect to area. We can instead presample a light source, using
stratified sampling to generate a collection of samples that we can reuse. The
stratified sampling helps ensure that the estimate of the average effect of the point
light is accurate, although the estimates for adjacent pixels are likely to be highly
correlated, which may be a problem in some cases. Essentially we're replacing an
area light with a collection of “micro-light” point lights. If there are too few, the
shadows cast by each may generate a noticeable artifact.
(a) Build a ray tracer that replaces each area light with multiple point lights in this
way. Do you see any artifacts? How is the running time affected as you increase
the number of samples on the luminaire?
(b) Instead of using all the micro-lights to illuminate each surface point, we can
pick one at random, essentially doing a single-sample estimate of the radiance
transfer from the light to the surface point. Doing this once per primary ray can
generate nice soft shadows. If we're shooting 25 primary rays (using stratified
sampling), and the area light is represented with 25 micro-lights, we'd like to use
each micro-light once. How should you pair up the primary rays and the micro-
lights? Do you foresee any problems?
(c) Implement your approach and critique the results.
Exercise 32.11: (a) Use the Poisson disk process to generate blue-noise sam-
ples on a line: Generate samples in the interval [ 0, 1 ] in which all are at least
r = .001 apart, until there is no more room to fit a new sample.
(b) Discretize the interval into 10,000 bins, and recorda1ineach bin that contains
a sample, and a 0 otherwise.
 
Search WWH ::




Custom Search