Jump to content
  • Advertisement
Sign in to follow this  
Dookie

Loading an alpha as a texture?

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

Gotta easy question for you! [smile] I have a texture that contains an alpha that I want to use as a separate texture. But I can't figure out how to load that alpha into its own texture object... How do I load that image's alpha into a separate texture object? I can get as far as 'D3DXCreateTexture' to create an object to hold my new texture, but I don't know how to actually load the image's alpha into the texture object (if that makes any sense). Anybody have any ideas on how to do this? Thanks in advance for the help, I really appreciate it!

Share this post


Link to post
Share on other sites
Advertisement
You need to lock the surface and extract the pixel data; throw away the non-alpha data, and provide that data to the new texture. There's no "magic way" of doing it (other than perhaps using render-to-texture).

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!