mayingzhen / nvidia-texture-tools

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

Dxt1a pixel format produce low quality alpha channel #134

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Convert the original tga (attached to this issue report) with nvcompress 
using option -bc1a
2. Open the dds created

What is the expected output? What do you see instead?
We expect to have a 1 bit per pixel alpha channel. Instead, we have 4x4 blocks 
either opaque or transparent.

You can read more infos here :
http://developer.nvidia.com/forums/index.php?showtopic=5046&hl=dxt1a

Original issue reported on code.google.com by jairbubb...@gmail.com on 26 Aug 2010 at 12:22

Attachments:

GoogleCodeExporter commented 8 years ago
I used for this example NVTT 2.08

I also tested with earlier versions, with NVTT 2.00 I also have different 
results but it's not good either. I attach the result to this comment.

Original comment by jairbubb...@gmail.com on 26 Aug 2010 at 12:39

Attachments:

GoogleCodeExporter commented 8 years ago
Turns out the problem is a mismatch between squish and my single color 
compressor.

The single color compressor considers that any pixel with alpha below 128 is 
transparent, while the squish compressor only considers transparent pixels 
those that have the alpha equal to 0. As a result you get the blocky output. 
I'll fix the single color compressor to use the same convention as in squish.

However, to get the same result as the old texture tools (which has a 128 alpha 
threshold), you will have to quantize the alpha explicitly, see:

http://code.google.com/p/nvidia-texture-tools/wiki/ApiDocumentation#Quantization

Original comment by cast...@gmail.com on 26 Aug 2010 at 4:31

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1138.

Original comment by cast...@gmail.com on 26 Aug 2010 at 4:41

GoogleCodeExporter commented 8 years ago
I checked latest revision :
with these settings "setQuantization(bfalse, bfalse, btrue, 128)"
I have the same results.

Thanks a lot for the quick fix !

(please also note, that it crashes if you set 256 as alpha treshold)

Original comment by jairbubb...@gmail.com on 27 Aug 2010 at 9:48