16 Bit Alpha Blending

Started by
2 comments, last by Qoy 23 years, 10 months ago
I'm thinking about trying to implement an alpha blending feature in my game for some menu screen effects, and for fades to various colors. I'm using 16 bit color. I have found plenty of documentation on alpha blending, color addition, subtraction, and numerous equations for color effects, so that's no problem, but going pixel by pixel and applying these effects is just WAY to slow. I've heard before of using color lookup tables to implement these effects in 16 bit, but I haven't been able to find much info on how to do this. Does anyone know where I can find information on doing *fast* alpha blending or other color translucency effects with 16 bit color? By the way.. I would prefer stuff that uses C/C++, because I don't know assembly yet. But if the only way to make it fast is assembly, that'll have to be it. Also, I'd rather not use MMX, because I have some friends who have some old computers Thanks! Edited by - Qoy on 5/31/00 1:06:08 AM
Advertisement
Hello there, well to start you''ll have to use assembly to get anywhere with alpha blending as it does take a fair bit of cpu power. It has to be as effiecent as possible. There''s an article here on gamedev.net in the reference area on MMX enhanced alpha blending, which actually also gives examples of a standard alpha blending and a couple of better improvements ending with the fastest one the MMX alpha blending routine. It uses C or C++ w/ inline assembly. With a little research and some mor einline assembly you can use the CPUID instruction to detect the presence of MMX support on a computer to decide which function to use. So it will run on a wide variety of machines.
Hope this helped!
See ya,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
ok. to recommend anything i would need a little more info. are you developing a DOS based game or Windows 9x/NT? if Windows then are you using DirectX/OpenGL etc? if DOS are you using VESA/MODE X, etc?
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
Jenova, I'm using Win9x with DirectX 7.

Cyberben, I think I'll try and find some assembly tutorials sometime soon then

Thanks!

Edited by - Qoy on May 31, 2000 7:58:46 PM

This topic is closed to new replies.

Advertisement