Game Engine Architecture

(Ben Green) #1

446 10. The Rendering Engine


z Application stage (CPU). Potentially visible mesh instances are identifi ed
and submitt ed to the graphics hardware along with their materials for
rendering.
z Geometry processing stage (GPU). Vertices are transformed and lit and
projected into homogeneous clip space. Triangles are processed by the
optional geometry shader and then clipped to the frustum.
z Rasterization stage (GPU). Triangles are converted into fragments that are
shaded, passed through various tests (z test, alpha test, stencil test, etc.)
and fi nally blended into the frame buff er.

10.2.1.1. How the Rendering Pipeline Transforms Data
It’s interesting to note how the format of geometry data changes as it passes
through the rendering pipeline. The tools and asset conditioning stages deal
with meshes and materials. The application stage deals in terms of mesh in-
stances and submeshes, each of which is associated with a single material.
During the geometry stage, each submesh is broken down into individual ver-
tices, which are processed largely in parallel. At the conclusion of this stage,
the triangles are reconstructed from the fully transformed and shaded verti-
ces. In the rasterization stage, each triangle is broken into fragments, and these
fragments are either discarded, or they are eventually writt en into the frame
buff er as colors. This process is illustrated in Figure 10.40.

Tools ACP

Application ProcessingGeometry

InstanceMesh VerticesVertice

Submeshes

Materials Textures

Textures

Mesh

Materials

Materials Textures

Rasterization

FragmentsVertice

PixelsVertice

TrianglesVertice

Figure 10.40. The format of geometric data changes radically as it passes through the vari-
ous stages of the rendering pipeline.
Free download pdf