From: ellman AT xs4all DOT nl () Newsgroups: comp.os.msdos.djgpp Subject: Re: Translucence in SVGA Using Allegro Date: 23 May 1997 12:35:51 GMT Organization: XS4ALL Message-ID: <5m42v7$63v$1@news0.xs4all.nl> References: <01bc671f$baf9a020$47e22499 AT syntaxlogic DOT earthlink DOT net> NNTP-Posting-Host: xs2.xs4all.nl Lines: 38 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <01bc671f$baf9a020$47e22499 AT syntaxlogic DOT earthlink DOT net>, Alex Kain wrote: >Is using the translucence/lighting procedure in Allegro possible and/or >practical in 640x480x256 svga? I'd like to know how fast such a task would >take, if it is possible. Lighting and transparency use lookup tables to do their funky stuff, so there's no major slowdown. The transparency has just 2 extra opcodes per pixel (and a 3rd extra opcode every 4 pixels). The lighting just has one extra opcode per pixel ( movb (%edi, %ebx), %bl which uses the table pointed to by %edi to look up %bl illuminated by %bh, storing the result in %bl). Lighting is almost as fast as drawing a regular sprite. Translucency is a bit slower because it reads from video memory as well as write. When using translucency, I strongly reccommend you trans_blit to a double buffer, and not directly to screen memory, as this is slower than main memory. With regular memory, it's also as fast as a regular sprite. Why don't you write a program to try is out to see if it's fast enough. Ultimately, wether or not is is possible depends on the speed of the slowest machine you want it to run on. At the moment, I am working on a function that does sprite stretching and translucency as a single stage, so you don't have to zoom the sprite to an intermediate bitmap and then blit it again onto the destination image with translucency. This may be included in the next version of Allegro. Maybe someday in the future, Allegro will include functions for doing translucency and lighting together. AE. -- Andrei Ellman -- URL: http://www.xs4all.nl/~ellman/ae-a -- ae1 AT york DOT ac DOT uk "All I wanna do is have some fun :-) || ae-a AT minster DOT york DOT ac DOT uk I've got the feeling I'm not the only one" || mailto:ellman AT xs4all DOT nl -- Sheryl Crow :-) || It's what you make of it.