Graphics Reference
In-Depth Information
In modern computer graphics, there are two basic approaches to rendering
a scene. The first is to project each object onto the image plane and color all
the pixels it hits accordingly. The second is to trace a ray from the viewpoint
through each pixel and determine the object that the ray hits, then color the pixel
by shading the object. The first approach is generally known as scanline render-
ing , because the objects are typically rasterized by scanning through the pixels.
Rendering methods employing the second method are collectively described as
ray tracing , although this term properly refers to rendering by tracing not only
rays through pixels, but also tracing reflected and transmitted rays in scene ob-
jects. The term ray casting usually means that the rays are not traced further than
the first object they hit, while path tracing refers to the more general process of
tracing light paths.
1.3.2 Scanline Rendering
In scanline rendering, each scene element is projected to the image plane, clipped
to the image, and rendered by filling in the affected pixels. The projection is ef-
fected by a projective (perspective) transformation represented by a 4
4matrix
constructed at the outset. The process of filling a projected polygon is sufficiently
simple that it was among the first operations implemented in the earliest dedicated
graphics hardware. Contemporary graphics hardware now allows the shading of
pixels for basic graphics primitives to be done according to a user-defined pro-
gram. One measure of the power of graphics hardware is the number of polygons
that can be rendered per second. Real-time rendering systems (such as video game
systems) have almost universally used some form of scanline rendering, but this is
beginning to change as improvements in hardware have made other approaches,
such as ray tracing, more practical.
In scanline rendering, care must be taken to assure that the rendering process
respects the apparent depth of the scene objects: if an object appears in front
of another, it has to be rendered accordingly. This is known as hidden surface
removal .The painter's algorithm works by rendering the objects from back to
front, but is seldom used because it requires sorting by depth, and does not prop-
erly handle mutually occluding objects. A modified form of the algorithm places
the scene objects in a tree data structure, with all potential mutually occluding
objects appropriately split. The tree structure, which is known as a binary space
partitioning tree (BSP tree) is then traversed to render the objects in the proper
depth order from any viewpoint. The method does, however, require extra storage
and significant preprocessing time.
The Z-buffer algorithm handles hidden surfaces by adding a depth channel to
the color channels in each pixel to store the depth of the object corresponding to
×
Search WWH ::




Custom Search