Sign in to follow this  

ALPHA TEST blending Functions

This topic is 4666 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

There are two concepts you're mashing up here: Alpha blend, and alpha test. Alpha blend involves blending semi-transparent color data. Alpha test is an early-out method of rejecting pixels if they're at lesat as transparent as some value, used for increasing efficiency.

Do a search on either one to get good results. Google is your best pal.

Share this post


Link to post
Share on other sites
thanks for your reply

actually , i am thinking in make colorkey effect that was in Directx7 by
useing alpha blending test function and ofcourse Alphabelind itself.

you know that Dx9 does not support colorkey when you drawing a texture.

so if any one has an idea for doing that , please tell me ,i am in bad need
for colorkey with DX9.

thanks

Emil

Share this post


Link to post
Share on other sites
As mentioned above there is no such thing as "alpha blending test". There is Alpha Testing and Alpha Blending.

To get colourkey, you use the colour key parameter to set a colour transparent in D3DXCreateTextureFromFileEx. This sets your colour key.

Then you enable Alpha Test and set a reference value which will not draw then transparent pixels.

For more info there are plenty of references in the Forum FAQ.

Share this post


Link to post
Share on other sites
go here at nvidia web site: http://developer.nvidia.com/object/ColorKey_in_D3D.html. this will tell you how to use alpha test ref value, and alpha test func to control the colorkey halo around alpha test objects. Old, but still relevant today.

Also note that the D3DX file loaders replace your supplied colorkey color with black, essentially creating a on/off alpha layer. So you could get a dark halo around colorkeyed edges for certain alpha test reference values. You could instead create your own alpha channel to indicate which pixels are colorkey, and NOT use the colorkey feature of the D3DX file loaders. This will leave the rgb layer unchanged, and allow for much better blends around colorkey edges.

joe
image space

Share this post


Link to post
Share on other sites

This topic is 4666 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this