Alpha textures

Started by
1 comment, last by dacrisxp 22 years, 6 months ago
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.
Advertisement
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...)
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
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.

This topic is closed to new replies.

Advertisement