dmsovetov / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

nvdecompress doesn't save DXT alpha channel #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open any dds file with for instance DXT5 compression
2. Run nvdecompress on the file

What is the expected output? What do you see instead?

I see a 24-bit TGA file without alpha channel. Instead I expect to see a
32-bit TGA file with alpha channel.

What version of the product are you using? On what operating system?

Latest svn (revision 489) on Fedora 8.

Please provide any additional information below.

Attached is a dds file, the tga output before the patch, and the tga output
after the patch, and the patch fixing the issue.

Original issue reported on code.google.com by amorilia...@gmail.com on 23 Mar 2008 at 10:50

Attachments:

GoogleCodeExporter commented 8 years ago
I just realized that of course DXT1 can have transparency as well, using the 3 
color
mode. I did not take that into account in my patch.

I guess that a "fool-proof" algorithm for distinguishing between RGB and RGBA 
modes
would be to look at the alpha channel and check whether or not all values are 
0xFF?

Original comment by amorilia...@gmail.com on 24 Mar 2008 at 10:31

GoogleCodeExporter commented 8 years ago
The patch looks good! 

I modified it so that the RGB mode is selected when the normal map flag is set, 
or
when  the format is RXGB, BC4, or BC5.

Let me know if it works for you. I'll integrate the changes back to the 2.0 
branch later.

Thanks for the bug report!

Original comment by cast...@gmail.com on 27 Mar 2008 at 1:58

GoogleCodeExporter commented 8 years ago
I've integrated it to the 2.0 branch. Closing as fixed.

Original comment by cast...@gmail.com on 27 Mar 2008 at 4:45

GoogleCodeExporter commented 8 years ago
Thanks, yes, that sounds like a much better algorithm for deciding on the alpha
channel :) I haven't seen this committed to the trunk yet? Anyway, looking 
forward to
the next release!

Original comment by amorilia...@gmail.com on 27 Mar 2008 at 9:37