About this time last year I found a need to write software render engine in DB classic. While it ended up being ported and fleshed out in Blitz2D (it's used in Visible Worlds, that version is faster than these) You could can get a reasonable frame rate in DB classic version with just filled faces and short clipping distance.
The main issue is Z buffering the scene. Both of the following demos (from last year) uses polygon level Z buffering. Meaning each face (within view) is sorted upon it's average Z depth from the camera and drawn using painters algorithm (back to front). While this is fast, it has one key problem, polygons can't intersect. In the days before hardware polygon renders, this is pretty much how the majority of software engines worked.
Hardware renders on the other hand calculate Z upon a per pixel basis (actually this is rare, if at all !), this allows faces to easily intersect other faces, but comes at a price. The cost of calculating Z per pixel is extremely expensive. (1 div and 2 mults and a compare per pixel drawn) Doing this in software and getting it to even run/move, let alone at a reasonable frame rate is quiet a challenge on it's own. The obvious solution is rather than calc perspective Z every pixel, calc spans of correct Z and linearly interpolate between them. This is how my never software engine works in Visible Worlds. The trade off, is some Z shearing when faces intersect.
The best solution for software render would be a Span Buffer. A span buffer holds the scene as a series of horizontal spans/strips. Rather than render a poylgon to the frame buffer with brute force, we convert it to spans and look for intersection/clip it against any existing spans in the display buffer. Each scan line has a span buffer. While giving a better (cleaner) result, it's not the easiest of implement and is equally clumsy with high levels of polygon geometry. The up side to this technique is that is allow you to only render the 'spans' that are visible. Giving an almost flat performance.
Anyway, I saw this thread the other day and tried to get a version running in DBpro, while it compiles (slowly..), it sure does work properly just yet. I'll give it go when p5 is released.
Here's the old demos for the time being.
http://www.underwaredesign.com/files/pub/TechDemos/UW3D_SoftwareRenderEngineV0_16DB.zip 1 meg (DB classic version)
http://www.underwaredesign.com/files/pub/TechDemos/UW3D_SoftwareRenderEngineV0_21.zip 390k (Blitz 2D version)
l8r,
Kevin Picone
[url]www.underwaredesign.com[/url]