Graphics Reference
In-Depth Information
of the voxel grid. Every pixel corresponds to one column of voxels that expands
into the third dimension. As we only get one linearly interpolated depth value
per pixel, the third dimension needs to be discretized manually.
To make effective use of parallel rasterization, we want to maximize the num-
ber of fragments per triangle. Since the rasterizer parallelizes over two dimensions
only, this number depends on the orientation of the triangle and the chosen di-
rection of projection. Fortunately, we can easily change the projection direction
per triangle in the geometry shader. The triangle's normal tells us which of the
three cardinal axes best fits the triangle's plane and thus will allocate the most
fragments.
Conservative triangle modification. Rasterization has to be altered in a way that
ensures that a pixel shader thread is executed for each intersected voxel column,
even those where the fragment center itself is not covered by the projected trian-
gle. Such modification of standard rasterization is appropriately called conserva-
tive rasterization and has been described in some detail in [Hasselgren et al. 05].
We use the vertex shader to transform positions into grid space. The geometry
shader ensures conservative rasterization, essentially shifting all triangle edges
outward by half a pixel diagonal. The resulting triangle will cover the centers of
all pixels that were only partially covered by the original triangle (see Figure 2.6).
We do not construct a precise and minimal conservative hull for each voxelized
triangle, as this would result in multiple triangles per input triangle. Instead, we
only construct one over-conservative triangle and manually clip fragments outside
the minimal conservative hull in the pixel shader. For this, an axis-aligned bound-
ing box (AABB) of the minimal conservative triangle hull is computed alongside
Conservative rasterization
Conservative depth
Clipping
aabb
fwidth(z)
Conservative
triangle
Half pixel
diagonal
Pixel
width
Depth
Rasterization plane
Figure 2.6. Over-conservative triangle modification with screen-space bounding box to
clip unneeded fragments in the pixel shader (left). Depth bounds estimation using the
derivatives of the linear triangle depth values (right).
Search WWH ::




Custom Search