Game Development Reference
In-Depth Information
3D Graphics Pipeline
The word pipeline describes the process of getting a 3D scene up on a screen. It
sa
great word because it implies a beginning that accepts raw materials, a process that
occurs along the way, and a conclusion from which the refined result pours. This is
analogous to what happens inside 3D game engines. The raw materials or resources
used in the pipeline include:
'
n Geometry: Everything you see on the screen starts with descriptions of their
shape. Each shape is broken down into triangles, each of which is composed of
three vertices, which is a basic drawable element in 3D engines. Some renderers
support points, lines, and even curved surfaces, but the triangle is by far the
most common. Meshes are collections of triangles.
n Materials: These elements describe appearance. You can imagine materials as
paint that you apply to the geometry. Each material can describe colors, trans-
lucency, and how the material reflects light.
n Textures: These are images that can be applied to objects, just as you might
have applied decals to plastic models or wallpaper to your kitchen.
n Lights: You must have light to see anything. Light can affect an entire scene or
have a local effect that mimics a spotlight.
n Camera: Records the scene onto a render target, such as the screen. It even
describes what kind of lens is used, such as a wide or narrow angle lens. You can
have multiple cameras to split the screen for a multiplayer game or render a
different view to create a rearview mirror.
n Shader : A shader is a bit of code that runs on the video card. It is able to con-
sume all of the above and calculate exactly what pixels to paint to the screen in
the right positions to faithfully render every triangle the camera can see. Shaders
typically work on either vertex positions or individual pixels inside a triangle,
but in truth they can be much more general than that.
Some of the processes applied to the raw materials include the following:
n Transformations: The same object can appear in the world in different orien-
tations and locations. Objects are manipulated in 3D space via matrix
multiplications.
n Culling: At the object level, visible objects are inserted into a list of objects that
are in view of the camera; at the triangle level, individual triangles are removed
if they don ' t meet certain criteria, such as facing the camera.
 
 
Search WWH ::




Custom Search