# DX11 Having trouble creating a .DDS file with an alpha channel

## Recommended Posts

I have a bitmap file that I created in photoshop that contains an alpha channel. When I try to use texconv to create the texture, the resulting texture only contains a fully white alpha channel instead of the alpha channel that I created in photoshop. The arguments that I passed to texconv are:

-f BC3_UNORM .\cat_bmp.bmp -dx10 -y

the output from texconv is this message:

reading .\cat_bmp.bmp (600x400 B8G8R8X8_UNORM 2D) as (600x400,10 BC3_UNORM 2D α:Opaque)
writing cat_bmp.DDS

I find it suspicious that the output says that its reading alpha as "Opaque" since the result I get is an alpha mask that is fully white... which sounds like what the output means by an "opaque" alpha.

What could be causing my alpha channel to turn all white?

##### Share on other sites
Posted (edited)

Do you have to use BMP? It's not exactly a convenient or portable format to use with alpha channels. Not to say the format is obsolete altogether.

Try a more common format such as PNG and see how that works.

Edited by Prototype

##### Share on other sites

No not at all, I also tried with a PNG with no luck. Is there a better format?

##### Share on other sites

PNG should work. Are you perhaps using an older version of Photoshop? I had some problems with that in the past, TGA is your safest bet in such case.

##### Share on other sites
Posted (edited)

I'm using photoshop cs5 here, is it considered old at this point? I just tried TGA and it does save the alpha channel!

The output from texconv is:

reading .\cat_bmp.tga (512x512 R8G8B8A8_UNORM 2D) as (512x512,10 BC3_UNORM 2D α:NonPM)
writing cat_bmp.DDS

It says that the alpha is "NonPM", however it clearly seems premultiplied to me since the transparency effect is visible in the image. Shouldn't the transparency effect not be visible unless the alpha is premultiplied?

Also interestingly texdiag.exe says that the alpha mode of the .DDS file is "Unknown". Maybe it's actually premultiplied?

Edited by maxmaxmax

##### Share on other sites

Make sure there are no transparent pixels in your base image, or color changes on the edges of opaque areas. The colors there should bleed outwards to fill the entire canvas. Also check your alpha channel in the channels panel.

Not sure if premultiplication is an issue but I have never faced it. How do you mean the effect is visible? Inside a viewer, your application? Frankly, I'm currently not using Photoshop nor DDS files so I cannot give you any more particular information than that.

##### Share on other sites
Posted (edited)

Thanks a lot for your help, it looks like everything is normal. Im able to create premultiplied and straight alpha images. The RGB channels are intact when in straight alpha and they're properly "clipped" when premultiplied. I was just interpreting the results incorrectly from inside my application. So using .TGA was the fix I needed.

Edited by maxmaxmax

##### Share on other sites

Great to hear, however I'm not sure if using TGA permanently is the best thing for your workflow. It's kind of an ancient format and filesizes are usually large (often uncompressed). It may also be marginally supported by other tools you might want to use. Aren't there any other converters that can do the job more easily?

##### Share on other sites

In my experience using TGA or PNG as input for texconv, delivers good results in the DDS (with alpha layer). I also found that GIMP works pretty easy when creating the alpha layer, copying in existing images, into the alpha layer of another image. The old DDSTEX tool can only do so much, too bad it doesn't support 'modern compression DDS formats'.

## Create an account

Register a new account

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 13
• 18
• 15
• 9
• 9