direct draw alpha capabilities

Started by
8 comments, last by Todd M Gillissie 23 years, 6 months ago
I''m new at DirectX programming, but very experienced in graphics. I know that alpha-blending looks much better than simple color-keying, so I am looking for a good explanation of how to set up a DD surface''s alpha info and blitting to a surface (secondary surface probably) using that info. The SDK doesn''t seem to cover this subject. Todd M. Gillissie gillissie@yahoo.com
Todd M. Gillissiegillissie@yahoo.com
Advertisement
DirectDraw doesn''t have native support for alpha blending, but you can do it manually writing directly to the pixels
theres a very good article here at gamedev on it, and even provides you with several optomised methods that use MMX

http://www.gamedev.net/reference/programming/features/mmxblend

hope this helps
Thanks Quantum, I''ll check it out.

Todd M. Gillissie
gillissie@yahoo.com
Todd M. Gillissiegillissie@yahoo.com
Actually, I''m still wondering why there is a dwFlag called "dwAlphaBitDepth" if DirectDraw doesn''t support alpha-blending natively. What with the Alpha flag?

Todd M. Gillissie
gillissie@yahoo.com
Todd M. Gillissiegillissie@yahoo.com
Directdraw has fields for a lot of things it doesn''t support, or only supports in certain situations... pixmap rotation for example.. I assume the alpha stuff is in there so It''ll all be ready if/when they add it in the future.
I believe there's an article around here describing how you can use D3D to do alpha rendering in 2D (D3D supports Alpha channels)(I does mean that the requirements for a 2D application include a 3D graphics board )

You know, I never wanted to be a programmer...

Alexandre Moura

Edited by - alexmoura on October 10, 2000 5:00:16 AM
there are some good examples of alpha blending at www.mrgamemaker.com
Whaddoyaknow? I just implemented that exact tutorial from mrgamemaker.com this very evening! It''s a very good tutorial, and the results are excellent.

Once you start using D3D in your 2D apps there''s a wealth of things you can do - ie. flip surfaces horizontally (and vertically) so you only need half as much sprite data loaded into vidmem, billinear filtering so you can scale your sprites without blockiness... the list goes on! Man.... this is good!

One problem though! I just found out my video card only supports textures that are a power of two in dimension (ie. 64x128). And I thought I had a good card

Ahh yeah, Quantum! D3D is faster than MMX (on most cards anyway), and D3D (being the nice API that it is) supports MMX if the user doesn''t have a D3D compatible grapics card. Best of both worlds, IMHO

wise_guy
well he specifically asked for directdraw alpha blending, i know of D3D alpha blending, but just wanted to give him that link
quote:Original post by A. Buza

Directdraw has fields for a lot of things it doesn''t support, or only supports in certain situations... pixmap rotation for example.. I assume the alpha stuff is in there so It''ll all be ready if/when they add it in the future.


None of it will be added to DirectDraw, actually. DirectX 8 (coming soon!) will integrate Direct3D and DirectDraw as one, so the DirectDraw interfaces as we know them will still be supported, but will no longer be updated. I''m not sure what DirectGraphics (?) will have as far as alpha-blending, but I guess we''ll find out in a month or so!

-Ironblayde
Aeon Software
"Your superior intellect is no match for our puny weapons!"

This topic is closed to new replies.

Advertisement