Jump to content
  • Advertisement
Sign in to follow this  
CodeBoyCjy

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

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

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!