Graphics Reference
In-Depth Information
Listing 36.5: Portal portion of the Portals and Mirrors algorithm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function portalRender(sector, clipPoly):
render all detail objects in sector
for each face F in sector:
if F is not a backface:
if F is a portal:
// Limit visibility by the bounds of the portal
projPoly = project( clipToNearPlane(F.polygon) )
newClip = intersect( projPoly, clipPoly )
if newClip is not empty:
portalRender( F.nextSector, newClip )
else:
// F is an opaque wall
render F.polygon
must lie on the faces of a sector (i.e., they cannot be detail polygons) and that for
a nonconvex sector, care must be taken not to reflect geometry that is behind the
mirror in front of it in the virtual world. That is, the virtual world seen through
the mirror must be clipped against the plane of the mirror, until the next mirror is
encountered. The issues that arise in this case are analogous to those for stencil-
masked mirrors; see Kilgard's technical report [Kil99] for an explanation of how
to perform the clipping and reflect the projection matrix.
36.9 Partial Coverage
There are several situations in which it is useful to extend binary visibility, also
known as binary coverage, to partial coverage values on the interval [ 0, 1 ] .Many
of these relate to the imaging model.
Consider the imaging model under which we defined binary coverage. For a
pinhole camera with an instantaneous shutter there is a single ray that can transport
light to each point on the image plane. The scene does not move relative to the
camera because the exposure time is zero. At a single point Q on the image plane
we can thus directly apply the binary visibility function to a point P in the scene.
Now consider a physically based lens camera model that has a nonzero shut-
ter time and pixels of nonzero area. The radiant energy measured by a pixel in
an image is an integral of the incident radiance function over the area of the
pixel, solid angle subtended by the aperture, and exposure time. This creates a
set of five parameters, sometimes labeled ( x , y , u , v , t ) , that identify the path from
a point Q ( x , y , u , v , t ) on the image plane through the lens to a point P ( t ) in the
scene. We introduce the primes to distinguish these from the points with which
we have previously been concerned.
The binary visibility function between points on P and Q may vary with the
parameters. The partial coverage (a.k.a. coverage ) of points in the set P ( t ) from
points in the set Q ( x , y , u , v , t ) is the integral of the binary visibility function over
all parameter variations within the domain of those sets. As the area-weighted
average of binary visibility, partial coverage values are necessarily on the range
[ 0, 1 ] . To extend the definition to whole surfaces, we can consider points on a
surface P ( i , j , t ) parameterized by both surface location ( i , j ) and time t .
 
 
 
Search WWH ::




Custom Search