Rendering Quake surfaces

David Etherton (
Sun, 17 Mar 1996 20:47:17 -0800

Date: Sun, 17 Mar 1996 20:47:17 -0800
From: (David Etherton)
Message-Id: <>
Subject: Rendering Quake surfaces

[Please forgive me if this is asked a lot, I can't get through to
the mail archives on
right now]

Like just about everybody else around here, I've been playing around
with trying to render the Quake levels. The Quake specs (3.0) have
proved invaluable.

First, in the List of Edges, if the sign bit of the edge is set, are
we supposed to look at edge ~i or -i? (Nodes use ~i to mark leaves
according to both the spec and my own experience). For the List of
Edges, though, neither ~i nor -i seem to work particularly well,
although -i seems to work slightly better.

I can traverse the BSP tree and find the leaf containing my camera
position correctly, so I know I've got the basics right. However,
when I try to render, I find that the list of surfaces often
tells me to (say) render surface 7 three times in a row, and that
it's got 30 edges in the surface.

Surfaces with small numbers of edges seem to "connect" together well
(ie the end vertex of one edge is the start vertex of the next, and
it forms a closed figure). Some surfaces with larger numbers of
edges seem to form closed figures if you sort the edges after
reading them in, but surfaces with 16 or more edges seem to not
form closed figures.

I can't imagine a fast renderer wanting to deal with anything larger
than a tri or a quad, so I'm suspicious of anything with more than
four edges. Combined with my experience with surfaces with large
numbers of edges having nonsensical edge lists, I wonder if we're
supposed to interpret the edge count differently if it's above
a certain value.

Also, why would the list of surfaces explicitly tell me to render
the same surface two or three times in a row? I haven't done an
exhaustive check, but it appears that every time a surface is
supposed to render several times in a row, it usually also has
a large number of edges.

Am I totally off in the weeds here or is anybody else fighting
the same things I am?

-David Etherton

ps. For what it's worth, I have been able to parse and render the
models perfectly; either a Z-buffer or a bucket Z-sort seems
to produce good results; the latter has some slight defects
(ever seen a PlayStation?) but is *much* faster on both my
PC and my SparcStation