Skip to content

Rendering Quake 3 Maps

Sui Jingfeng edited this page Apr 1, 2018 · 7 revisions

The rendering process has five steps:

1. Determine the set of visible faces.

2. Partition the visible faces into transparent and opaque lists.

3. Clear the frame buffer and render the sky box.

4. Render the opaque list in front-to-back order.

5. Render the transparent list in back-to-front order.

The first two steps do not involve any OpenGL calls. Step 3 renders a cube centered at the viewer with a pre-warped texture to create the illusion of a detailed 3D environment. The practice of creating and rendering sky boxes is discussed elsewhere and is not detailed further in this document. Steps 4 and 5 render the actual visible surfaces of the map. The opaque list contains triangles that will be rendered without alpha blending. It is sorted from front to back to take advantage of early-out depth tests on newer graphics hardware. The transparent list contains alpha blended surfaces which must be rendered from back to front to generate a correct image. A straightforward quicksort on the camera-space depth of first vertex of each surface is sufficient for these purposes. For the kinds of maps involved, splitting overlapping polygons for truly correct render order or using a radix sort for faster sorting will only increase the complexity of a renderer with improving the resulting image quality or frame rate.

Clone this wiki locally