Graphics Reference
In-Depth Information
Chapter 32
Rendering in Practice
32.1 Introduction
In this chapter we show implementations of two renderers—a path tracer and a
photon mapper—with some of the optimizations that make them worth using.
Both approaches are currently in wide use, are fairly easy to understand, and form
complete solutions to the rendering problem in the sense that they can be shown
(under reasonable conditions) to provide consistent estimates of the values we
seek (i.e., “properly” rendered images).
We're not recommending these as ideal renderers. Rather, we treat them as
case studies. They are rich enough to exhibit of the complexities and features of a
modern renderer; they provide the foundation necessary for you to read research
papers on rendering.
We assume that you've implemented the basic ray tracer described in Chap-
ter 15. Much of this chapter also depends heavily on Chapters 30 and 31.
In the course of implementing these renderers, we describe ways to struc-
ture the representation of geometry in a scene, of scattering, and of samples that
contribute to a pixel. These are not always in a form immediately recognizable
from the mathematical formulation of the previous chapters, as you'll know from
Chapter 14.
In Section 32.8, we discuss the debugging of rendering programs, showing
some example failures and their causes, and suggesting how you can learn to iden-
tify the kind of bug from the kind of visual artifacts you see.
32.2 Representations
As you build a ray-casting-based renderer, your choices of representations will
have large-scale impacts. Is the scattering model you've chosen rich enough to rep-
resent the phenomena you wish to simulate? Is it easy to sample from a probability
distribution proportional to
v i ? Is your
scattering energy-conservative? Does your scene representation make ray-scene
v
f s (
v i ,
)
| v ·
n
|
for some fixed vector
v
881
 
 
 
Search WWH ::




Custom Search