Advertisement

hardware Alpha-blending

Started by June 18, 2000 08:53 PM
0 comments, last by Zimans 24 years, 6 months ago
Is there any hardware support for alpha blending in DirectDraw? From what I''ve read it''s done in Direct3d, but all the alpha-blending stuff I see in the tutortorials is software alpha-blending. I would like to incorporate alpha-blending into my engine (for fog overlays etc.) but I would like to do it in hardware if at all possible.. -Zims
No there''s no hardware Alpha blending support in DirectDraw, however you can do two things:
1.) Use Direct3D to do a 2d game by create a 2 triangle which are positioned to take up the whole screen... A virtual 2D surface then you can texture these triangles with what would be your game''s screen and alpha blend over them etc, etc... Never done this but heard of it and seen it in tutorials...

2.) Use software, which isn''t so bad actually, just make sure you use MMX. There''s a good tutorial on MMX enhanced Alpha Blitting in the Resource section here on GameDev.Net, using C or C++ and some inline assembly (Actually a LOT of inline assembly)

Software is probably fine, just be wise with your resources. You can also create a 50/50 alpha blending that only does the 50/50 ratio between two images but it''s MUCH faster than true alpha blending, so for things like clouds and fog you coulde just go 50/50 between the cloud and ground/units/trees etc...

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

This topic is closed to new replies.

Advertisement