Archived

This topic is now archived and is closed to further replies.

Zimans

hardware Alpha-blending

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites