Archived

This topic is now archived and is closed to further replies.

dacrisxp

Alpha textures

Recommended Posts

I''m currently trying to load textures with an alpha channel. The files are of type "TGA". I tried loading with D3DXCreateTextureFromFile (regular) and the EX version, and the alpha channel doesn''t load. Is it possible to load textures with alpha channel in DirectX? And how is it done? Thanks for your help.

Share this post


Link to post
Share on other sites
Yes, but in some cases, the program that saves the targa file doesn''t create the alpha channel correctly.

Try this - use the DirextX texture tool to explicitly create a .dds file with an alpha channel and load that file with the D3DX functions. Once you are assured that your code works (it should), try the .tga file. If you don''t get the alpha channel it''s probably the file not the code.

How are you checking the alpha channel? Is it possible you simply don''t have alpha blending enabled? (just checking...)

Share this post


Link to post
Share on other sites
Thanks for your information. Actually it was the code. I found a great tutorial on alpha-blended textures, and now it works perfectly, with TGA files. Thanks again.

Share this post


Link to post
Share on other sites