[SDL] Software 3D Engine

Bob Pendleton bob at pendleton.com
Mon May 19 13:04:01 PDT 2003


On Sun, 2003-05-18 at 14:59, Drirr C. wrote:
> ----- Original Message -----
> From: "JVFF Programming" <jvffprogramming at ieg.com.br>
> To: "SDL Mailing List" <sdl at libsdl.org>
> Sent: Saturday, May 17, 2003 5:34 PM
> Subject: [SDL] Software 3D Engine
> 
> Back when there was no hw acceleration for 3D (at least on PCs) I played a
> while with implementing my own sw rendering (just polygon rasterizaton and
> clipping). What I focused most on was having sub-pixel accurancy and
> perspective correct texture mapping. I don´t have much time to work on that
> now, but I´m willing to contribute with that code (under LGPL) and help with
> the project.
> 
> Drirr C.

A long time ago, in the days of VGA, I wrote a 3D texture mapping engine
for a game (don't ask, I don't admit to having worked on it) and helped
port a famous 3D engine to the Mac. The key to those old engines was not
the 3D graphics part of the code. It just isn't that hard to write a
textured polygon renderer (http://gameprogrammer.com/5-poly.html
http://gameprogrammer.com/6-text.html both origianlly written in '93), a
clipper, or a 3D transformation
library((http://gameprogrammer.com/4-fixed.html). What is hard is
getting hidden line and surface elimination working so that you only
spend time rendering the visible surfaces. A lot of modern 3D engines
count on a Z buffer to get the details right and use approximate
visibility techniques at the model level. In a software renderer a
Z-buffer can be a serious problem. Z-Buffers are big and when combined
with rendering buffers tend to cause cache instabilities. If you go back
and look at the DOOM engine, there were two key technologies that made
it possible. The first was the use of binary space partitioning to
eliminate hidden surfaces and a special case solution to the texture
mapping transformation that eliminated the per pixel divide in texture
loop. The second is no longer that much of a problem, but the use of
something like BSP trees is critical.

All in all, why not move this over to the gameprogrammer.com mailing
list where it is ON topic rather than here where it is OFF topic.

		Bob Pendleton

P.S.

I would like to see a 3D model layer based on something like BSP trees
(or what ever is current) with a graphics layer that can be mapped to
OpenGL *or* software. It would be nice to have. Now that I have said
that I'm hoping someone will point to the thirtyleven projects that
already do that. :-)

> 
> 
> > Hello,
> > Is anyone working on some type of 3D Engine in SDL without OpenGL? If
> > not, wouldn't it be a good idea to start some sort of SDL_3d? I'm
> > willing to help. ThanX in advance,
> >
> >        JVFF
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
-- 
+-----------------------------------+
+ Bob Pendleton: independent writer +
+ and  programmer.                  +
+ email:  Bob at Pendleton.com         +
+-----------------------------------+






More information about the SDL mailing list