Jump to content
  • Advertisement
Sign in to follow this  
Locutusborg

applying alpha to an existing texture

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

Hello, In my game I am trying to make something dissapear. I want to do this by decreasing the aplha value, so that the mesh becomes more and more opague and eventually cant be seen anymore (alpha = 0) I use the following code for this: pShipMeshMaterials[pListPlayer->ship.meshnr]->Ambient.a = 0.2f; pShipMeshMaterials[pListPlayer->ship.meshnr]->Diffuse.a = 0.2f; pShipMeshMaterials[pListPlayer->ship.meshnr]->Power = 0; pShipMeshMaterials is the pointer to the materialbuffer array this code works perfectly for the material, it becomes opaque. however, when a texture is applied to the material, the code no longer seems to have any effect. Can anyone tell me how to fix this? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Been a long time since I did any D3D9 coding like this, but I seem to remember that setting up the texture cascade (::SetTextureStageState() calls) to use _TFACTOR for the alpha args, and then a call to ::SetRenderState(D3DRS_TFACTOR ... ) would allow you 'global' control over the alpha value.


hth
Jack

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!