Skip to main content
gamedev.net
🔒 Locked

Software 3D Engine Optimizations

Started by SeanHowe Jan 3, 2001 at 12:49 AM 3 replies 750+ views
Original Post
SeanHowe
SeanHowe
To anyone out there who''s ever made a software 3d engine: What sort of optimizations did you do to get it running quickly? Because right now, when rendering 1000 gouraud shaded triangles, I get about 4 fps P.S. - Don''t post to tell me there''s no reason to make a software 3d engine in this day and age. You''ll be wasting your time since I know everything you''ll say in that post. I''d really like to receive responses relevant to the question.
delphi3d
delphi3d
quote:
Original post by SeanHowe

To anyone out there who''s ever made a software 3d engine:
What sort of optimizations did you do to get it running quickly? Because right now, when rendering 1000 gouraud shaded triangles, I get about 4 fps

P.S. - Don''t post to tell me there''s no reason to make a software 3d engine in this day and age. You''ll be wasting your time since I know everything you''ll say in that post. I''d really like to receive responses relevant to the question.


When writing a software rasterizer, a lot of things that you take for granted from a 3D card suddenly aren''t there anymore. The most important would probably be fill rate. What resolution are you running this in, BTW?

You can use things like a coverage buffer (try flipCode) or an s-buffer (see http://www.gamedev.net/reference/articles/article668.asp) to eliminate overdraw. Charles Bloom has an article (http://www.cbloom.com/3d/techdocs/pipeline.txt) about how best to organize the rest of your polygon pipeline (the pre-rasterization bit especially).

Good luck

- Tom
Tom Nuydens delphi3d@gamedeveloper.org www.gamedeveloper.org/delphi3d
SeanHowe
SeanHowe
Hey, thanks, the S-Buffer article really helped, I''m getting almost 10 FPS now!
Seriously though, that''s a lot better than before, and I''m sure there''re some optimizations I can make
MK42
MK42
Hey!

It''s nice to see someone is still doing it ''the hard way''. There''s just so much you learn about what your 3D card does, once you''ve done it yourself. Anyways, my questions/suggestions would be:

1. What resolution are you running in? With software I wouldn''t go higher than 512x384.

2. How do you rasterize your triangles/polygons?

3. Your inner (drawing) loop might be killing you ... how do you calculate the goraud values?


With software and rasterizing there''s one BIG rule to keep in mind ... always try to do things incrementally. You shouldn''t have to do major calculations in inner loops ... just a x+=dx; here or a r+=dr; there. In my rasterizer I also worked with fixed point arithmetic, reducing everything to just integer ops. I never got around to using MMX for the inner loops, but I''m sure it would have been a time saver, too ...

- MK42

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.