Game Development Reference
InDepth Information
Initialize 3×3 filter lookups using links
Start traversal
with
upper link
Start traversal
with
upper link
Start traversal
with
upper link
Start traversal
with
upper link
Start traversal
with
upper link
Start traversal
with
upper link
Start traversal
with
head
Start traversal
with
right link
Start traversal
with
right link
Figure 1.5.
We initialize the traversal of the transmittance function using the corre
sponding link to the closestdepth fragment of the neighboring pixel (going first in
y

andthenin
x
direction).
Since lookup time is slow for DSM, it is essential for DSM filtering to avoid a
naive implementation where the overall lookup time grows linearly with the filter
size. Searching the whole list of a neighboring pixel for the correct fragment is
prohibitively expensive. A binary search would reduce the complexity but is not
very suitable for implementation in a compute shader and on linked lists.
Instead we exploit spatial coherence and assume that the neighboring frag
ment closest in depth has a similar index in its linked list. At this stage we utilize
the linking structure from
Section 1.3.3
,
which links list elements closest in depth
in order to get a good initial guess for the lookup of a neighboring fragment. This
way, the transmittance function has to be traversed from the beginning (the head
element)
only once
per pixel, regardless of the used filter size. Once a fragment
corresponding to the current depth is found, it is possible to quickly access the
neighboring fragments for computing the remaining filter samples.
In our implementation, first the fragment corresponding to the lowerleft cor
ner of a filtering window is computed (see Figure 1.5). Next the positions of the
fragments linked by
right
and
upper
are used as initial guesses for finding the
correct fragment position of a neighboring sample in the DSM (as depicted in
Figure 1.4
)
. Then this sample's linked list is traversed by following either
prev
or
next
to determine the correct depth (fragment position in the list). If spatial
coherence holds, each traversal only requires a few iterations.
For a filter kernel size of 7
7 and realistic transparency settings, the links
speed up the frame times by up to 50% for a framebuffer resolution of 1
,
280
×
×
720
and up to 100% for a resolution of 1
,
920
×
1
,
080 when compared to a bruteforce
Search Nedrilad ::
Custom Search