Jump to content
  • Advertisement
Sign in to follow this  
raider8654

Direct3D Whole Texture Transparency

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

Hi all, I know how to adjust the alpha component of each pixel in a texture. However, what I want is a way to call in to Direct3D, say, "hey, let's render this texture with an alpha of 0.5", and then that way I don't have to consume valuable CPU iterating over every pixel just to set the alpha to the same value for each pixel. Instead, let's just have one function call that tells Direct3D to render this texture with the same alpha throughout.

Is it possible to achieve this? Or do I really have to manually iterate through the whole texture and set each pixel's alpha component? See what I'm looking for is I want a slider that the user can adjust back and forth, and as the slider moves, so too does the transparency of the texture in question. So I need to be able to adjust the texture's transparency on the fly.

Any help here would be appreciated!

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Sure. Set the alpha component to the color of the quad/geoemtry vertices either in code or in the vertex shader if you use one.

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!