Well I've decided it's that time for me, like countless other leagues
of programmers, to write my own realtime 3D PC engine. My goal is to
generate a realtime 3D system that will let me construct and walk
or fly through my own virtual worlds. Photorealism is not a concern
here, but a high frame rate (minimum 10+ FPS) is. I'm shooting for
a C++ implementation, "true" 3D (no 2.5D DOOM/Wolf3D-like tricks),
with simple flat-shaded polygons. From other demos I've seen with
such attributes, quite good speed is attainable with such realism
I feel I have a fairly solid handle on the technical and math issues
involved in writing a 3D engine (clipping, matrix transformations,
projections). However, I do have some questions about optimization.
Since a high frame rate is one of the primary goals, I feel it is
important to address optimization early in the design.
Specifically, the following issues concern me:
1) Windows or DOS? I am running Win 3.1, and I do have WinG installed.
I would like full-screen fast graphics -- does this basically rule out
using Windows, or can WinG do the job? Also, does WinG accelerate all
graphics, or only apps specifically written for some special WinG API?
Where could I find documentation on this API? Would it be best just
to stick to DOS?
2) Should I write my own line drawing/polygon filling routines? The
Windows API, as well as Turbo C for DOS, provide presupplied functions to
draw lines and filled polygons. It would be nice not having to re-invent
the wheel, but will such presupplied routines be fast enough for a
realtime 3D engine? I am not sure if the major slowdown would be
the mathematics involved, or if the actual screen updating would also
be a bottleneck.
3) What, if anything, needs to be recoded in assembly for speed?
Matrix multiplication? Screen updating? Could a straight C++
implementation achieve 10+ FPS with flat-shaded polygons? Where
should I be most careful about making sure code is optmized?
Any other general pitfalls to watch out for would be appreciated.
Thanks in advance. I'm looking forward to this project.
| | _ |__ | | | Coordinator for the "Fisher Price PXL 2000"
| | | | | | | camcorder mailing list. Email for info.