Graphics Reference
In-Depth Information
into the scene. This region is often referred to as the unit cube, although in reality it is not
a complete unit cube, due to its range in the Z direction, but it is still commonly referred
to this way. We will explore clip space and normalized device coordinates further in the
"Rasterizer Stage Processing" section.
Clip and Cull Distances
Now that we have an understanding of how the position data received by the rasterizer
should look, we can consider some of the other inputs it may receive. The next two input
attributes we will look at were initially discussed in the vertex shader section. The system
value attributes, SV_ClipDistance and SV_CullDistance are both consumed in the ras-
terizer stage as additional user-defined inputs to the culling and clipping operations. These
allow the culling and clipping processes to be manipulated with customized data provided
by the programmable shader programs. We will discuss these in more detail later in the
"Rasterizer Stage Processing" section.
Viewport Array index
In addition to the clip and cull distances, the rasterizer stage can also receive the SV_
ViewportArrayIndex system value semantic. This is an unsigned integer that specifies
which viewport definition structure the rasterizer should use when rasterizing a primitive.
The mechanics of how these individual viewports affect the output will be described in
detail in the "Rasterizer Stage Processing" section.
Render Target Array index
We also have seen that the geometry shader can specify the SV_RenderTargetArrayIndex
system value semantic to indicate which texture slice of a render target array to write to.
This is simply an unsigned integer value that selects the texture slice to target. We don't
implement any sample programs that use this system value semantic in the topic, but there
is a very good Direct3D 10 sample in the DXSDK that demonstrates this technique being
used, called CubeMapGS. In addition, a further description of how this is used can be found
in (Zink).
Additional Input Attributes
The final group of inputs that can be sent to the rasterizer stage is actually a wide variety
of different types of information. Any additional attributes in the vertex structure that are
received by the rasterizer represent data that the developer has defined at each vertex of the
input primitive. In the case of a triangle, there are three instances of an attribute available
for each triangle at each of its vertices. Since the rasterization process generates fragments
Search WWH ::




Custom Search