Sign in to follow this  
Dookie

Loading an alpha as a texture?

Recommended Posts

Dookie    290
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
hplus0603    11347
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this