[DirectDraw9] Alpha Blending

shouzama

Freshman
Joined
Jan 20, 2003
Messages
38
Location
Another World
Planning the features of my engine, I found out that the Alpha Blending feature will be much required...

I looked around the web a little, and I found out a lot of somewhat confusing chunks of informations.

However, looking into DirectX9 SDK, I found something that can be very helpful.

See this argument, and look at the DrawEffects part.

I cannot understand, however, most of the DrawEffects properties (AlphaDestinationConstant and so on...)

Someone has any idea?
 
I'll try to explain me more clearly (reading my post above doesn't make much sense).

What I mean is:
* Is AlphaBlending integrated whithin DirectDraw9?
* If so, through DrawEffects method, how can I implement such operation?
 
I'm not sure about DirectX 9, but in previous versions there was no support for alpha blending in DirectDraw. It may have changed for this release, but I'd be surprised.
 
I've seen a number of threads on this same topic in the Microsoft managed DirectX forums. I haven't used DirectDraw myself, but from what I can glean from the posts, Alpha Blending is not supported. There is support for color keys, to create transparent regions for sprites but that's about it.

The following is a snippet of a thread with Patrice Scribe and Oleg:
<Patrice>
AFAIK alpha was never implemented in DirectDraw (similarly I don't know a
card able to do to the rotation effect in hardware). That would left us with
:
- alphablend in software (possibly using an external DLL)


<Oleg>
When I look in description properties of Microsoft.DirectX.DirectDraw.Device I can see, that Alpha surfaces are supported. There are two device cappability sets: hardware and hardware emulation. And that last set support alpha surfaces.

O.K. I feel that capabilities has wrong flags. So I only can use non-DirectX software alpha operations: DirectDraw alpha not implemented, and managed D3D is not supported on all videocards except very newest ones.


<Patrice>
My understanding is that in the past DirectDraw 7 was integrated as part of Direct3D (you have for example Z buffer clearing capabilities and a texture was a DirectDraw surface).
Nowadays the D3D pipeline is independant. I wonder if those caps were meaningfull only when used on a DDCAPS_TEXTURE surface...


-Nerseus
 
I understand your dilemma - I had a look at DirectDraw for use in my own sprite engine, but the limited abilities with regard to translucency were a big factor in my choosing Direct3D in the end. I haven't had a good look at D3D sprites yet, but I have textures mapped onto rectangles with full alpha blending, transformations, etc. Besides, accelerating through the 3d card is probably faster than just using DirectDraw in the first place. So that's my recommendation.
 
DirectDraw9 does have support for alpha blending and rotation. I can't figure out how to use the DrawEffect object either though. The documentation says nothing.

DirectDraw9 is more than just a managed interface to DirectDraw7. And some things, like Draw and DrawFast seem to be backwards from their DirectDraw7 counterparts.
 
A quote from Phil Taylor (Project Manager of DirectX while DX9 was developed, currently at ATI):
the DDraw in Managed is a wrapper around DDraw7, to provide that functionality to the .NET world. it is nothing else, dont get confused.

I don't think there is anything vague about that. Here's a link to his post:
http://discuss.microsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind0301A&L=DIRECTXDEV&P=R13997&I=-3


DirectDraw has never even hinted at having alphablending. It does have colour keying which is a very different thing.

And while the API had extensions for rotation, they were never actually implemented.
 
Back
Top