Graphics Reference
In-Depth Information
(a)
(b)
(c)
Figure 3.7. (a) Upsampling using regular bilinear filter causes blurry edges. (b) Up-
sampling using bilateral filter to preserve sharp edges. (c) Image after being processed
by MSAA antialiasing filter.
For each full-resolution pixel we will sample the depth and color of the four
nearest half-resolution pixels. For each of the four samples, a weight is calculated
to account for regular bilinear filtering. Each weight is then scaled down based on
the difference between the high-resolution depth and the sample's half-resolution
depth. The bigger the difference in depth, the smaller the weight of the half-
resolution sample. All weights are divided by their total sum to make sure they
are normalized. The four samples are scaled by their weight and added together
to form the final resulting color (Figure 3.7(b) and 3.7(c)) [Shopf 09].
3.4 Dithered Ray Marching
In order to improve the rendering performance even more, we decided to reduce
the number of ray-march steps we were taking. Lowering the number of ray-
march steps will cause banding artifacts in the volumetric light (Figure 3.10(a)
and (b)). This is caused by the fact that each sample will have more influence
on the final image and the error caused by undersampling gets worse.
To reduce the artifacts, we added a small grayscale dither pattern texture
(Figure 3.9(a)), which is tiled across the screen. For each fragment that is being
rendered, we sample this texture and use the grayscale value to offset the ray-
march sample positions over depth. The values in the texture range from 0.0
to 1.0, where 1.0 defines an offset as big as the distance between two ray-march
samples (Figure 3.8(b)).
The dither texture (Figure 3.9(a)) is 4
4 pixels in size. The distribution
of the ray-march offsets within the dither texture is based on the Bayer matrix
[Bayer 73]. The offsets are arranged such that each successive offset has the
biggest possible 2D distance within the texture considering the texture will be
tiled (Figure 3.9(b)). Because each volumetric light pixel within a 4
×
4 boundary
will get a different offset, we get a nicely dithered result (Figure 3.10(c)).
×
Search WWH ::




Custom Search