Newsgroups: comp.os.msdos.djgpp From: Elliott Oti Subject: Re: Inevitebly slow writes in VESA? Sender: usenet AT phys DOT uu DOT nl (News system Tijgertje) Message-ID: In-Reply-To: Date: Sun, 11 Oct 1998 14:55:26 GMT X-Nntp-Posting-Host: ruunat.phys.uu.nl Content-Type: TEXT/PLAIN; charset=US-ASCII References: Mime-Version: 1.0 Organization: Physics and Astronomy, University of Utrecht, The Netherlands Lines: 43 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Sat, 10 Oct 1998, Tal Lavi wrote: > My ray-caster needs only to draw vertical lines in a 16bpp mode. This, > ofcourse, makes it hard to write a dword in a time. > > I have succeeded in rewriting the engine so that he'll calculate two > vertical scan-lines at once, so they could be drawn on the screen at > once(I have not calculated each one dependendly, stored them, at then > drawed them, but actually calculated both simultaniusly). > > I am calculating every two CONSECUTIVE veritical scan-lines at once(0&1, 2&3, > etc..), which means that every dword that is written in dword-alligned to the > beginning of the LFB. > > To my disapointment, I haven't gained ALLOT more speed, rather than just > some. > > Does anyone has a clue about what could have gone wrong? according to my > calculations, I should have gained X8 speed. > My guess(which is very improbable), is that the beginning of the LFB is > not DWord alligned. Can this be true? IMHO you're focussing too much on alignment issues, when other things are probably affecting your program speed. You should actually be more specific: 1. What sytem are you running on ? What CPU, what bus, what video card. 2. How fast are read/writes to your video card anyway? On my old Trident 9440, 16bpp 640x480 has a *maximum* refresh rate of around 14 frames per second, and that's when the program is doing nothing but block-copying from main memory to video RAM (this drops to 10 fps for individual writes). 3. What do you mean by "slow" or "fast"? How does it compare to other raycasters you've seen? Check the 3D engines page (http://www.cs.ac.tu-de/~ki/engines.html -- this is from memory, so it may be wrong) and compare your program to other programs. 4. Have you profiled the program? Where is the code spending most of its time? Can you make any algorithmic changes to increase the speed? HTH, Elliott Oti http://www.fys.ruu.nl/~oti Eh? Where's my sig?