[243] | 1 | \chapter{Visibility Preprocessing}
|
---|
[246] | 2 |
|
---|
| 3 |
|
---|
[243] | 4 | \section{Introduction}
|
---|
[246] | 5 |
|
---|
| 6 |
|
---|
| 7 | \section{Related Work}
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | \section{Overview of Visibility Preprocessor}
|
---|
| 11 |
|
---|
| 12 | The proposed visibility preprocessing framework consists of two major
|
---|
| 13 | steps.
|
---|
| 14 | \begin{itemize}
|
---|
| 15 | \item The first step is an aggresive visibility sampling which gives
|
---|
| 16 | initial estimate about global visibility in the scene. The sampling
|
---|
| 17 | itself involves several strategies which will be described in
|
---|
| 18 | section~\ref{sec:sampling}. The imporant property of the aggresive
|
---|
| 19 | sampling step is that it provides a fast progressive solution to
|
---|
| 20 | global visibility and thus it can be easily integrated into the
|
---|
| 21 | game development cycle.
|
---|
| 22 |
|
---|
| 23 | \item The second step is visibility verification. This step turns the
|
---|
| 24 | previous aggresive visibility solution into either exact, conservative
|
---|
| 25 | or error bound aggresive solution. The choice of the particular
|
---|
| 26 | verifier is left on the user in order to select the best for a
|
---|
| 27 | particular scene, application context and time constrains. For
|
---|
| 28 | example, in scenes like a forest an error bound aggresive visibility
|
---|
| 29 | can be the best compromise between the resulting size of the PVS (and
|
---|
| 30 | framerate) and the visual quality. The exact or conservative algorithm
|
---|
| 31 | can however be chosen for urban scenes where of even small objects can
|
---|
| 32 | be more distructing for the user.
|
---|
[247] | 33 | \end{itemize}
|
---|
[246] | 34 |
|
---|
| 35 |
|
---|
| 36 | \section{Aggresive Global Visibility Sampling}
|
---|
| 37 |
|
---|
| 38 | In traditional visibility preprocessing the view space is
|
---|
[272] | 39 | subdivided into view cells and for each view cell the set of visible
|
---|
[246] | 40 | objects --- potentially visible set (PVS) is computed. This framewoirk
|
---|
| 41 | has bee used for conservative, aggresive and exact algorithms.
|
---|
| 42 |
|
---|
| 43 | We propose a different strategy which has several advantages for
|
---|
| 44 | sampling based aggresive visibility preprocessing. The stategy is
|
---|
| 45 | based on the following fundamental ideas:
|
---|
| 46 | \begin{itemize}
|
---|
| 47 | \item Replace the roles of view cells and objects
|
---|
| 48 | \item Compute progressive global visibility instead of sequential from-region visibility
|
---|
| 49 | \end{itemize}
|
---|
| 50 |
|
---|
[287] | 51 | Both of these points are addressed below in more detail.
|
---|
[246] | 52 |
|
---|
| 53 | \subsection{From-object based visibility}
|
---|
| 54 |
|
---|
[247] | 55 | Our framework is based on the idea of sampling visibility by casting
|
---|
| 56 | casting rays through the scene and collecting their contributions. A
|
---|
| 57 | visibility sample is computed by casting a ray from an object towards
|
---|
[272] | 58 | the view cells and computing the nearest intersection with the scene
|
---|
[269] | 59 | objects. All view cells pierced by the ray segment can see the object and
|
---|
[247] | 60 | thus the object can be added to their PVS. If the ray is terminated at
|
---|
| 61 | another scene object the PVS of the pierced view cells can also be
|
---|
| 62 | extended by this terminating object. Thus a single ray can make a
|
---|
| 63 | number of contributions to the progressively computed PVSs. A ray
|
---|
[272] | 64 | sample piercing $n$ view cells which is bound by two distinct objects
|
---|
[247] | 65 | contributes by at most $2*n$ entries to the current PVSs. Appart from
|
---|
| 66 | this performance benefit there is also a benefit in terms of the
|
---|
| 67 | sampling density: Assuming that the view cells are usually much larger
|
---|
| 68 | than the objects (which is typically the case) starting the sampling
|
---|
| 69 | deterministically from the objects increases the probability of small
|
---|
| 70 | objects being captured in the PVS.
|
---|
[246] | 71 |
|
---|
| 72 | At this phase of the computation we not only start the samples from
|
---|
| 73 | the objects, but we also store the PVS information centered at the
|
---|
| 74 | objects. Instead of storing a PVSs consting of objects visible from
|
---|
| 75 | view cells, every object maintains a PVS consisting of potentially
|
---|
| 76 | visible view cells. While these representations contain exactly the
|
---|
| 77 | same information as we shall see later the object centered PVS is
|
---|
| 78 | better suited for the importance sampling phase as well as the
|
---|
| 79 | visibility verification phase.
|
---|
| 80 |
|
---|
| 81 |
|
---|
[247] | 82 | \subsection{Basic Randomized Sampling}
|
---|
[246] | 83 |
|
---|
| 84 |
|
---|
[247] | 85 | The first phase of the sampling works as follows: At every pass of the
|
---|
| 86 | algorithm visits scene objects sequentially. For every scene object we
|
---|
| 87 | randomly choose a point on its surface. Then a ray is cast from the
|
---|
| 88 | selected point according to the randomly chosen direction. We use a
|
---|
| 89 | uniform distribution of the ray directions with respect to the
|
---|
| 90 | halfspace given by the surface normal. Using this strategy the samples
|
---|
| 91 | at deterministicaly placed at every object, with a randomization of
|
---|
| 92 | the location on the object surface. The uniformly distributed
|
---|
| 93 | direction is a simple and fast strategy to gain initial visibility
|
---|
| 94 | information.
|
---|
[246] | 95 |
|
---|
| 96 |
|
---|
[247] | 97 | The described algorithm accounts for the irregular distribution of the
|
---|
| 98 | objects: more samples are placed at locations containing more
|
---|
| 99 | objects. Additionally every object is sampled many times depending on
|
---|
| 100 | the number of passes in which this sampling strategy is applied. This
|
---|
| 101 | increases the chance of even a small object being captured in the PVS
|
---|
| 102 | of the view cells from which it is visible.
|
---|
[246] | 103 |
|
---|
| 104 |
|
---|
[247] | 105 | \subsection{Accounting for View Cell Distribution}
|
---|
| 106 |
|
---|
| 107 | The first modification to the basic algorithm accounts for
|
---|
[272] | 108 | irregular distribution of the view cells. Such a case in common for
|
---|
| 109 | example in urban scenes where the view cells are mostly distributed in
|
---|
| 110 | a horizontal direction and more view cells are placed at denser parts
|
---|
[247] | 111 | of the city. The modification involves replacing the uniformly
|
---|
| 112 | distributed ray direction by direction distribution according to the
|
---|
| 113 | local view cell density. We select a random viecell which lies at the
|
---|
| 114 | halfpace given by the surface normal at the chosen point. We pick a
|
---|
| 115 | random point inside the view cell and cast a ray towards this point.
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 | \subsection{Accounting for Visibility Events}
|
---|
| 119 |
|
---|
| 120 |
|
---|
[251] | 121 | \subsection{View Cell Representation}
|
---|
[247] | 122 |
|
---|
[251] | 123 | In order to efficiently use view cells with our sampling method, we require a view cell representation which is
|
---|
[247] | 124 |
|
---|
[251] | 125 | \begin{itemize}
|
---|
[272] | 126 | \item optimized for view cell - ray intersection.
|
---|
[251] | 127 | \item flexible, i.e., it can represent arbitrary geometry.
|
---|
| 128 | \item naturally suited for an hierarchical approach. %(i.e., there is a root view cell containing all others)
|
---|
| 129 | \end{itemize}
|
---|
| 130 |
|
---|
[255] | 131 | We meet these requirements by using a view cell BSP tree, where the
|
---|
[269] | 132 | BSP tree leafs are associated with the view cells. Using the BSP tree, we
|
---|
[255] | 133 | are able to find the initial view cells with only a few view ray-plane
|
---|
| 134 | intersections. The hierarchical structure of the BSP tree can be
|
---|
| 135 | exploited as hierarchy of view cells. If neccessary, the BSP approach
|
---|
| 136 | makes it very easy to further subdivide a view cell.
|
---|
[269] | 137 | Currently there are two approaches to generate the initial BSP view cell tree.
|
---|
[251] | 138 |
|
---|
| 139 | \begin{itemize}
|
---|
[255] | 140 | \item We use a number of dedicated input view cells. As input view
|
---|
| 141 | cell any closed mesh can be applied. The only requirement is that the
|
---|
| 142 | view cells do not overlap. We insert one view cell after the other
|
---|
| 143 | into the tree. The polygons of a view cell are filtered down the tree,
|
---|
| 144 | guiding the insertion process. Once we reach a leaf and there are no
|
---|
| 145 | more polygons left, we terminate the tree subdivision. If we are on
|
---|
| 146 | the inside of the last split plane (i.e., the leaf is representing the
|
---|
| 147 | inside of the view cell), we associate the leaf with the view cell
|
---|
| 148 | (i.e., add a pointer to the view cell). Hence a number of leafes can
|
---|
| 149 | be associated with the same input view cell.
|
---|
| 150 | \item We apply the BSP tree subdivision to the scene geometry. When
|
---|
| 151 | the subdivision terminates, the leaf nodes also represent the view
|
---|
| 152 | cells.
|
---|
[251] | 153 | \end{itemize}
|
---|
| 154 |
|
---|
| 155 |
|
---|
[246] | 156 | \section{Visibility Verification}
|
---|
| 157 |
|
---|
| 158 |
|
---|
| 159 | \subsection{Exact Verifier}
|
---|
| 160 |
|
---|
[247] | 161 | The exact verifier computes exact mutual visibility between two
|
---|
| 162 | polyhedrons in the scene. This is computed by testing visibility
|
---|
| 163 | between all pairs of potentially polygons of these polyhedrons.
|
---|
[246] | 164 |
|
---|
[247] | 165 |
|
---|
| 166 |
|
---|
[246] | 167 | \subsection{Conservative Verifier}
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 | \subsection{Error Bound Verifier}
|
---|
| 171 |
|
---|
| 172 |
|
---|
| 173 |
|
---|