Graphics Reference
In-Depth Information
deferred shading. Of course, early z -cull doesn't optimize computational local-
ity for scenes with thousands of lights, so GPU architects will continue to study
approaches to true deferred shading.
Inline Exercise 38.1: Suppose that the depth complexity of a pixel is n (i.e., a
ray traced through the pixel would intersect n different surfaces in the scene,
only the nearest being visible), and that these surfaces are processed in random
order, but with early z -cull, that is, a fragment is shaded only if it's in front of
all other fragments we've encountered so far. What's the expected number of
fragments that are shaded during the course of rendering this pixel?
38.8.2 Binned Rendering
We usually define rasterization as the process that converts screen-coordinate geo-
metric primitives directly to pixel fragments. But rasterization to larger screen
areas, such as to n
n -pixel tiles, is also possible. The GeForce 9800 GTX
rasterizer is a case in point—it outputs 2
×
2 quad fragments to simplify texture-
mapping calculations, as described in Section 38.6.1. Binned rendering splits ras-
terization into two phases: a first phase that outputs medium-size tile fragments,
each corresponding to a (typically) 8
×
32-pixel grid in screen
coordinates, followed by a second phase that reduces each tile fragment to pixel
fragments. Of course, tile fragments include information derived from the screen-
coordinate primitive so that second-phase rasterization can produce the correct
pixel fragments.
Binned rendering actually splits the entire rendering process into two phases,
corresponding to the two phases of rasterization. During the first phase the scene
is processed through tiled rasterization, and the resultant tile fragments are sorted
into bins, one bin corresponding to each screen tile. Only after the first phase is
completed (i.e., after tile fragments for the entire scene have been generated and
sorted into bins) does the second phase begin. During the second phase each bin
is processed individually to completion, yielding an n
×
8-, 16
×
16-, or 32
×
×
n tile of pixels that is
deposited in the framebuffer.
Binned rendering has several attractive properties.
Local memory: The absolute guarantee of framebuffer data coherence—
only pixels within the tile are accessed—allows pixels to be processed in
local memory, rather than cached from main memory. Both power and
main-memory cycles are conserved, making binned rendering an attractive
solution for mobile devices.
Full-scene anti-aliasing: Recall that multi-sample anti-aliasing requires
storage for multiple color and depth samples at each pixel. As quality
is improved by increasing the sample count, both storage and bandwidth
become prohibitively expensive when rendering is to the entire frame-
buffer, but they remain economical when rendering is limited to a small
tile of pixels. Even more advanced rendering algorithms, such as order-
independent rendering of transparent surfaces, can be supported with clever
use of local memory.
Deferred shading: Limiting rendering to a small tile of pixels addresses
the key limitations of deferred shading: its requirements of excessive
 
 
 
Search WWH ::




Custom Search