Software 3D engine questions

Search this archive.

From: Gregory Huczynski (greg@dcs.gla.ac.uk)
Date: Tue 17 Apr 2001 - 12:39:46 IDT


Hi,

I want to write a software-rasterising 3d engine for learning purposes. 
Essentially I really just want to start with a put_pixel routine and then work 
up (lines,polygons,texturing,etc). I was considering building on top of 
svgalib, and have a number of questions to ask:

Is svgalib fast enough for realtime 3d? I assume that it is, as there appear 
to be Doom and Quake ports that use it, but as I haven't seen them in action, 
I don't know what speed/quality they have.

If so, what is the fastest way of drawing a pixel/frame? Should I somehow be 
accessing the framebuffer directly (how?), or would multiple calls to 
gl_setpixelrgb suffice? Could I get away with using the given routines in the 
gl library (gl_setpixelrgb,etc), or would I need to write my own custom 
routines for speed purposes?

I thought that logically, the fastest way of writing a pixel (without 
resorting to assembler) would be if I could access the framebuffer in memory 
as one large linear array, use pointer arithmetic to set the particular 
pixel's rgb value (taking into account pixel bit size, etc), and then copy the 
buffer into video memory. However, I'm not sure if this is possible with 
svgalib, as VGA modes seem to have a very strange structure involving multiple 
pages that I'm confused about.

Basically, I would like to have a fast basis on which to write a 3d engine. 
I'm more interested in writing the engine itself than getting bogged down in 
fine-tuning the utmost speed out of the video card, but on the other hand, I 
would like the actual pixel drawing to be fast. I would also like to write the 
entire engine in C (not assembler), and would like to use true/real colour, 
not 256 vga lookup, at a high-ish resolution.

I would appreciate any help/suggestions/code-examples given (I feel that 
svgalib might be the library I've been looking for!)

Thanks a lot

Gregory Huczynski

P.S. I have looked at the ThreeDKit example that comes with svgalib, but it's 
quite confusing, and it also appears to use assembler.


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST