Jump to content
  • Advertisement
Sign in to follow this  
mrmrcoleman

Direct 3D textures and transparency.

This topic is 5058 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 there. I have a 2d interface which is comprised of several direct 3d textures. I need to be able to make some of these textures fade to fully transparent. Is there some simple way to do this or would I need to manipulate the pixel data in the texture? If this is the case how would I go about getting to the pixel data to decrease the alpha? Has anybody come across this problem before, it seems like something that would be a common requirement? Any help would be greatly appreciated. Mark Coleman

Share this post


Link to post
Share on other sites
Advertisement
1) Set the texture stage operation of stage 0 to Modulate, set argument 1 to TextureColor and argument 2 to diffuse color.
2) Change the alpha component of the diffuse color.

As you change the alpha component, the texture will either fade in or out.

Share this post


Link to post
Share on other sites
BTW, another really popular way to fade is to place an entirely transparent black square ON TOP of whatever you want to fade and then slowly decrease the alpha diffuse until the object behind it seems to fade out.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!