How do early 3d polygon renderers know which polygons are in front of others?

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
Post Reply
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

How do early 3d polygon renderers know which polygons are in front of others?

Post by psycopathicteen »

Like in Star Fox. Also, what happens when 2 polygons intersect in 3d space? Does it just draws what it thinks is closer to the camera in front?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: How do early 3d polygon renderers know which polygons are in front of others?

Post by tepples »

The question appears to concern depth sorting in mid-1990s PC games and games for Super FX, 3DO, Jaguar, 32X, Saturn, and PlayStation.

In broad terms, the painter's algorithm involves some sort of Z (depth) sorting. The complexity of the plane-to-plane comparison may vary based on the speed-accuracy tradeoff that the developer sets, and a lot of games for the original PlayStation have corner cases that they occasionally get wrong. In particular, drawing intersecting triangles was generally poorly defined until GPUs supporting a Z buffer (such as the Nintendo 64's RDP) were common. I've read about a lot of PlayStation games running a bucket sort based on Z values. Sometimes each mesh has lists of pre-sorted polygons from each of four angles depending on which of the four points on the top of the mesh's bounding cube is closest (or farthest in the case of a mesh viewed from below). Use of pre-sorted lists means only the meshes (and not the constituent triangles) need to be sorted against one another. Some software renderers on PC and 32X have used span buffers, which track Z values of horizontal spans of pixels within a scanline.

Michael Abrash's Graphics Programming Black Book might help.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: How do early 3d polygon renderers know which polygons are in front of others?

Post by Oziphantom »

Star fox is sparse enough that they probably don't care when things intersect and reply on things not intersecting for the most part. This combined with a fixed draw order. I.e background, enemies, lasers, player gives you the broad sort they might sort background elements and enemies individually though if there are enough cases where the enemy goes behind background elements.
Post Reply