From: dstamp@watserv1.waterloo.edu (Dave Stampe-Psy+Eng)
Subject: VGA Polys: Done!
Date: Sun, 10 Nov 1991 01:34:54 GMT
Message-ID: <1991Nov10.013454.11948@watserv1.waterloo.edu>
Organization: University of Waterloo



OK.  The renderer part of the fast graphics package is finished, and
should be up for FTP by Monday (Bernie Roehl will post the address.)
The package runs on 386 or 486 computers with VGA cards (sorry, 286'ers,
but the performance on 16-bit machines is below VR standards.  Besides,
the code needs 32-bit integer math).

It uses 320x200x16 color mode, and supports 8 display pages.  It is 
intended for large memory-model C programming, but someone should be
able to write C adapter routines for Pascal.  I am considering a 
320x200x256 color version, but the speed would be halved and I don't
know if its worth it.  Can't really touch it for a few weeks anyway.

The code consists of several .asm files and a C file with support and
complex bits.  It implements:

3 and 4 -sided polygons (solid color filled).  Needs corner points
only, and clips to fit any rectangle on the screen, with input points
anywhere in the range of 16-bit integers.

Full screen clears to solid colors and copies from other pages.

Multiple page display, synchronization and flipping.

Fast line draws and Cohen-Sutherland clipping to rectangle on screen.

Speeds (486/25 PC and _slow_ Paradise VGA card)

24x24 triangular polys: 5800/sec, 3-10 uS trivial clip reject
30x30 4-sided polys:    3800/sec (30% faster than 2 3-sided poly method)
24-pixel lines (45 deg.): 15600/sec
Line clipping: <2 uS trivial accept/reject, 5-10 uS clipped
Screen clear: 10.5 mS
Screen copy:  21.0 mS

There's not much of a demo to go with it, just this copy/poly draw
animated demo.  It draws 4 BIG polys on a copied background, with over
1/3 of the screen covered, at 36 frames/sec on a 386 or 486.  It does
360 frames per cycleing of the figures so you can time it yourself.

I spent some time looking thru the Dr. Dobbs articles and these routines
are 30% to 1000% faster than theirs.  I am making the code etc. available
for non-commercial purposes (i.e. talk to me before building games etc.
with it!).

Next step will have to be perspective transforms, clipping, depth sorting
etc.  I'd like to see others working on this, as I won't really have time 
nearly a month. 

Hope you get a bang out of it.


--------------------------------------------------------------------------
| My life is Hardware,                    |                              | 
| my destiny is Software,                 |         Dave Stampe          |
| my CPU is Wetware...                    |                              | 
| Anybody got a SDB I can borrow?         | dstamp@watserv1.uwaterloo.ca |
__________________________________________________________________________
