Game Development Reference
In-Depth Information
stream for the first iteration is the initial input stream that was created in Stage 1.
All subsequent iterations use the intermediate output stream from the preceding
iteration as the input. Two output streams are utilized in the geometry shader.
An intermediate output stream is used to hold viewable regions that are intended
for further processing. A final output stream is used to hold viewable regions that
require no further processing in the next iteration, and are to be rendered as part
of Stage 3 of the algorithm.
Within the geometry shader, each viewable region is processed and one of the
following three actions is performed:
Option 1. If the viewable region is determined to not intersect with the view
frustum, it is culled. The culled viewable region is not added to either the
intermediate or the final output stream.
When determining whether or not the viewable region intersects the view
frustum, one must be mindful of any displacements performed during Stage 3
of the algorithm. When using this algorithm for terrain rendering, each
viewable region is extruded into a volume, based on the maximum displace-
ment that may be added in Stage 3. It is this extruded volume that is then
tested for intersection with the view frustum.
Option 2. If the viewable region span θ , calculated at the viewable region R 's
center position R C , and with the applied offset R λ , written as θ ( R C ,R λ ),
is greater than the maximum viewable region span θ max , then the view-
able region R is split into four quadrants ( R 1 ,R 2 ,R 3 ,R 4). The quadrants,
each of which become viewable regions themselves, are then added to the
intermediate output stream to be reprocessed at the next iteration. A spe-
cial code, unique to each quadrant, is also added to the output stream to
identity the relative location of the split viewable regions to their parent
viewable region. This extra piece of information, referred to as a relative
quadrant code , and usually encoded into a 2-bit mask, is later utilized by
the LOD Transition Algorithm (explained in Section 1.2.4 ) when rendering
each viewable region.
To split the viewable region R (see Figure 1.3(a) ) into the quadrants (see
Figure 1.3(b) ) , we create four new viewable regions ( R 1 ,R 2 ,R 3 ,R 4) with
their respective center positions ( R 1 C ,R 2 C ,R 3 C ,R 4 C ) and applied offsets
( R 1 λ ,R 2 λ ,R 3 λ ,R 4 λ ) defined as follows:
R 1 C = R Cx
2 R λ ,
2 R λ ,R Cy +
Search Nedrilad ::

Custom Search