Archived

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

Alpha Blitting and Alpha Channels

This topic is 5747 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to know how to perform an Aplpha blitting on DDraw and how I work with Alpha Channel Surfaces, and how to use them. (e.g. I want to put a sword with an aura, and I want the aura to be translucent, but the sword to be opaque). How I do this?~~ Thanks.

Share this post


Link to post
Share on other sites
I have had thoughts on doing this recently, but I have a few questions:

Extra bits will be needed to store alpha, so bit-depth will have to increase 24bit->32bit, is this right?

Also how comparable (speed wise) do you think the optimised alpha-draw will be when compared to using 3d hardware, e.g. using Direct3D''s ID3DXSprite?

If the speed is not comparable, how would you go about using graphics hardware if it was present (graphics abstraction between DirectDraw and Direct3D (for blitting sprites )?

I know these are pretty vague questions, sorry

Share this post


Link to post
Share on other sites
you either use directdraw or you use direct3d. there is no use directdraw and use d3d (you can with dd7 and d3d7 but its a mess, troublesome, not worth the hassle, some drivers choke, etc). there is no comparison between doing alpha blittin yourself vs the hardware doing it. plain fact: the video card has MUCH more bandwidth for the operation since everything is done local to the card across fast busses and such. on the other hand you would have to cross the system bus (to read/write to system ram) then upload the result (across the agp/pci/isa bus). if you have a good framework with directdraw, and just want to add this effect, do some reasearch on alpha blending (ie see google.com and search the board AND the articles on the site). there is a wealth of info out there.

if you trully want to give up some of the directdraw freedom, then learn d3d8 and use hardware to do the blending. be forewarned things are different and you CANT easily do per pixel operations, nor do anythign per pixel very fast (pixel shaders dont do this, i wont discuss what thingsm cause if you dont know you probably aint doing them and dont have to worry).

personally if get down to a minium, software alphablending using mmx is quite fast, especially if its only a few sprites. you probably wont notcie a speed difference until you get many sprites (4 or more) that are somewhat large before you should definatly use d3d hardware blending. of course you could use the alternate method of, only showing the aura on even frames like in capcom and neogeo arcade games. though for the effect to look good you MUST keep at least 60 frames per second or things look terrible.

Share this post


Link to post
Share on other sites