Sign in to follow this  
CodeBoyCjy

how to use the alpha chanel both from vertex color and texture

Recommended Posts

hey This is a simple problem with shaders. But I don't want to use shader to do the job. I expect this: src_alpha = alpha_fromtexture * alpha_fromvertexcolor ; Could it be possible with fixed pipeline ? If it's possible , how could I do it with the SetTextureStageState Func?? I realy appreciate your kind help

Share this post


Link to post
Share on other sites
device->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE);
device->SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_DIFFUSE);

The first one is telling it to get the Alpha information from the texture.
The second one is telling it to get the Alpha information from the vertex.

Now depending on the Blending Operation use it will adding multiplpy them or add them.

In your situation since you want to multiply both alpha values then you can set it the blending that way
device->SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_MODULATE)

Share this post


Link to post
Share on other sites

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