Sunteți pe pagina 1din 18

1

Visibility Determination
Anthony Steed, Yiorgos Chrysanthou 1999-2003

2
Overview
Why visibility culling?
Avoid the incorrect image being
displayed
Allows speed-up
With ray-casting, visibility was
solved implicitly for the image space
Now we are projecting polygons, we
need to address this directly
3
Types of Visibility Methods
Back-face elimination
List priority
Ordering in Projection Space
Depth-sort
Ordering in Object Space
Binary Space Partition Trees
Image precision E.g
Z-buffer
Ray Casting

4
Back Face Culling
We were specifying the order (clockwise
or counter clockwise) for a reason
Polygons whose normal does not face the
viewpoint, are not rendered
P
i

5
Back Face Culling
Thus if we have the plane equation


and the COP (c
x
,c
y
,c
z
)


if the COP is in front of the polygon (and is
this visible
( ) 0 , , = + + = d cz by ax z y x l
( ) 0 , , >
z y x
c c c l
6
Back Facing Culling
Alternatively, think about projection space
The transformed polygon must have a normal
with a negative z component to be visible
7
Calculating the Normal
If the plane equation is expressed so:







Suppose S is the projection matrix and thus
transformation point q is
q = pS
( ) 0 1 , , ,
0
=
(
(
(
(

=
d
c
b
a
z y x
l p
8
Calculating the Normal
If q = pS
Then qS
-1
= p
So qS
-1
.l

= p.l
Let m = qS
-1
Then q.m = 0

Therefore transform plane equation
by inverse of projection transform
9
Back Face Culling
Final words for a single convex
object, ANY order of polygons is
correct
10
Visibility (Priority) Ordering
You would render P
2
THEN P
1
to see correct
result (Painters Algorithm)

Given a set of polygons S and a viewpoint C, find an
ordering on S such that for any 2 polygons
intersected by a ray through C, P
i
has higher priority
than P
j
11
z-sort in Projection Space
Simply sort back to front all polygons
based on their mid-point
Doesnt always work e.g.
12
depth-sort (Newell et al. 72)
Note that two polygons P&Q can be rendered in
any order, if they do not overlap in X-Y
P can be rendered before Q if its Ps z range is
completely behind Qs
13
depth-sort
P can be rendered before Q if
Z-extent of Q is wholly in front of P or
Y-extent of Q does not overlap P or
X-extent of Q does not overlap P or
All points on P lie on the opposite side of Q
than the COP or
All points on Q lie on the same side of P as
the COP or
The projections of P and Q on the XY plane
do not overlap (full 2D polygon overlap test)

14
Object Space Methods
Depth-sort tells us the relationship
between a set of polygons, but must be
computed every time
However we know that most of the time
objects do not intersect
Can we work in object space to find gross
relationship between the objects P and Q
so that we know all polygons in P

can be
rendered before Q ?
15
Schumacker 69
A polygon/object on the same side as the
viewpoint has higher priority than one on the
opposite site
16
Schumacker 69
If we have more than one object on one side
then repeat the same reasoning and add
more partitioning planes between these
objects
17
Other Uses of Culling
Done enough to ensure correct
view, but we can do more to ensure
speed (is a topic later in the course)
View Volume Culling
Visibility Culling
Occlusion Culling
18
Summary
Distinction between types of visibility
algorithm
Projection space
Object space
Image space
Back face culling as a preliminary step
How priority ordering can be achieved
through depth-sort and object-space
methods

S-ar putea să vă placă și