New Nvidia Texture Tool Exporter doesn't save alpha channels

Sure, should i send you the link to the file via email? nvidia@discoursemail.com?

Emailing nbickford@nvidia.com, the official Texture Tools email at texturetools@nvidia.com, or DMing me would work!

OK, I think I figured it out! It seems to be a quirk in Photoshop - the solution is to flatten the image, then shift-select the alpha channel in addition to the RGB channels in Photoshop before exporting to DDS, like this:
image
My guess is that when the alpha channel isnā€™t selected, Photoshop only sends the red, green, and blue channels to the plugin, ignoring the alpha channel. But for this file, Photoshop wonā€™t let you select all of the channels at once without flattening the image, probably because the windows tint layer is the only layer with an alpha channel (which you can see by selecting the alpha channel, and then going back to the Layers pane and seeing which layers are highlighted red). So the solution is to flatten the image first.
This works in the standalone exporter, because the standalone exporter reads a pre-flattened copy of the image with transparency that Photoshop stores in the PSD file (in most cases). So in some sense, it reads a copy that has already been flattened and already has the alpha channel selected.

Hope this helps!

1 Like

Thankyou! Iā€™d have no problems attaching the alpha to every layer, as itā€™ll be on every image i export. so im wondering if theres a way to attach it to all the layers

It looks like if you select all of the layers in the Layers pane and then create a new alpha channel, it should wind up being the alpha channel for all of the layers at once.

Hope this helps!

Hi developers. It is obvious that you have not even TRIED to save DDS with full black, 0 alpha. If you had, the problem would be obvious. I donā€™t know how you are able to not know what is happeningā€¦ unlessā€¦ you have not tried to save DDS using your plugin, ever. Saving any image with 0 alpha will result to all RGB information being lost, turned to 0,0,0.

And it is not like this is a small problem or unknown. There is no change in behavior between legacy and new in photoshop CS6. The way you are oblivious that there is a problem just means: you do not use your own programs. Quite unbelievable that this problem still persists.

Hi squidcap,

Could you check in the About box to make sure youā€™re using version 2020.1.3, and not version 2020.1.2, and can you check to see if you see the same thing on a supported version of Photoshop (i.e. Photoshop CC)? You may also want to check that the ā€œPremultiplied Alpha Blending (Alpha is Transparency)ā€ box is unchecked when exporting images. See below for more info.

If you read the messages above, I explain how and why this information loss occurred with zero-alpha pixels in the new version as a side effect of internal premultiplied alpha conversion. We fixed this issue in 2020.1.3 by using unpremultiplied alpha internally , and implemented an interesting trick to try to maintain colors when premultiplied alpha is enabled. Iā€™m only human - there could still be flaws in the implementation! However, Iā€™ve tested this with batches of images with zero-alpha pixels in both the standalone and Photoshop versions, and can confirm it works on those images.

Itā€™s interesting that you note that the behavior is the same as the legacy version on Photoshop CS6, as the Photoshop version of the tool specifies Photoshop Creative Cloud (and testing was done on CC 2019 and 2020). The Photoshop API has also changed in that time. Could this be the reason for what youā€™re seeing? For instance, if you export from Photoshop to a PNG file and then convert to DDS using the standalone exporter, do you get the same result?

Although we aimed to have the same feature set as the legacy version, the internal image processing of the tool has been almost completely rewritten, so itā€™s surprising that you would be seeing the same problem with both versions, given how different they are internally.

I managed to make it work, by uninstalling the newer plugin and installing the good old legacy version. I need to still do 1-bit alpha via GIMP but at least i can do something now (btw, GIMP doesnā€™t do DDS very well either, some formats work, some donā€™t, it also has fucking awful feature where it loads some old version from some cache it has hidden somewhere and not the one you see when you click on it in file dialog but i digressā€¦ made trouble shooting a freaking painā€¦). Large DDS DXT5 crashes the newer PS plugin, both saving and openingā€¦ or it takes hundreds times longer than usual to open a the save options window. The weird thing being that the exact same pipeline i use now, used to work in the past, nothing else has changed but OS from 7 to 10.

So this still seems not to be fixed. The plugin still does not see the alpha channel in a multilayer file and still requires extra steps to export alpha. Can you pls see how the old one was made and fix it? Or were do I get the official version of the old exporter?

1 Like

Hi all - Iā€™m happy to announce that weā€™ve just released Texture Tools Exporter 2021.1.1, which should solve the last aspect of this (without a need for a workaround). The underlying issue turned out to be pretty interesting - more details below. Thanks to themeatballhero and others for providing a test case for this. It also contains several new features useful for game modding; see the release notes for more info.

As it turns out, in Photoshop, if I delete the Background layer (say by replacing it with a normal layer) and add an alpha channel, Photoshop will report that the image has 5 channels, instead of the 4 I might have expected (and that it displays)! Previously, the exporter would always sample alpha from the 4th channel - but in this case, the 4th channel is usually entirely opaque, and the 5th channel is the added alpha channel!

What seems to be going on is that since the image has no Background layer, Photoshop figures the image might not be opaque, and so it adds a 4th channel for transparency between the RGB and added alpha channels. Usually, though, when using an alpha channel the layers overlap in such a way that there are no transparent regions in the composite (i.e. the 4th channel is blank). The effect is that the exporter looks like it doesnā€™t save the alpha channels - because it was looking at the hidden transparency channel!

The previous 2020.1.3 workaround of flattening the image worked because that turned the existing layers into a Background layer, so the alpha channel would shift from channel 5 back to channel 4. This also means that another workaround would have been to use Layer > New > Background from Layer on the bottom layer. These workarounds arenā€™t needed in the new version.

In 2021.1.1, we now always use the last channel for alpha instead of the 4th channel, meaning that it should always use the last alpha channel if there is one, and transparency otherwise. (Note that if you have 2 alpha channels, this means we should pick up the 2nd alpha channel.)

Thanks!

3 Likes