Graphics Reference
In-Depth Information
Combining the view and projection matrices, we get the view frustum—a region of space that
defines what is visible through the camera. The process of excluding objects that do not lie
within this space is called frustum culling. This region is roughly the shape of a pyramid on its
side, with its top cut off as shown in the following figure. In this figure, everything between the
Z-planes 1 (our 0.5f near plane) and 2 (our 100f far plane), and within the bounds of the
pyramid, will appear on the screen.
A view frustum for a view from the left-hand side
Other than our rendering commands, the render loop does two additional operations to the
render loops of Chapter 1 , Getting Started with Direct3D . We first cleared the depth/stencil
view, which resets our depth buffer. This is important to do or we will have depth bleeding
between frames.
Then after creating the WVP matrix, we updated the WVP matrix constant buffer with a call
to DeviceContext.UpdateSubresource . HLSL, by default, expects the matrix to be in
column-major order. Therefore, we must first transpose our SharpDX row major WVP matrix
(write the rows of the matrix as the columns).
Renderers
The IA input layout that we defined requires that the vertices are two 4-component
floats making up 32 bytes. The first 16 bytes represent the object-space position,
and the second 16 bytes represent the vertex color.
 
Search WWH ::




Custom Search