neoragex2015 / nvidia-texture-tools

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

Wrong RGBA .DDS output on RGB input. #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a RGB and RGBA .tga image.
2. Use the nv::Image class to load the file.
3. Now set nvtt::CompressionOptions.setFormat(nvtt::Format_RGB)
4. Set output to .DDS container.

What is the expected output? What do you see instead?
The expected output is a .dds file in RGB format, what u will get is a
bigger RGBA dds image.

What version of the product are you using? On what operating system?
I tryed 2.02 and also the trunk code from the date im writing this, im on
winxp 32bit Vs2005.

Please provide any additional information below.

in the nvtt.h i see:
enum Format
{
   Format_RGB,
   Format_RGBA = Format_RGB,
}
So it seems the code is designed this way or it is an internal bug.

The problem is that the alpha channel is written black, which messes up
shader behavior, since the shader will sample white on a texture that has
no alpha channel. Next Problem is that the texture is bigger than they
should be, wasting important memory. 
I can see that nvtt is just a compression library mainly for dxt types, but
i would expect correct behavior if i simply route the image through the lib
and use the mipmap or resize functions.

Original issue reported on code.google.com by andyieg....@googlemail.com on 2 Jul 2009 at 1:12

GoogleCodeExporter commented 9 years ago
When you specify an RGB mode, you have to specify the exact pixel format with 
some of
the other methods of the compression options. The pixel format is RGBA8. See:

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

Original comment by cast...@gmail.com on 3 Jul 2009 at 12:00

GoogleCodeExporter commented 9 years ago
Ah thx my fault, did not read the full documentation :)
Was assuming handing over RGB means default RGB order output, at least that 
worked
for the ARGB images without the need for a order mask/output bits.

But just changed it and it works now.

so thx for the fast reply

Original comment by andyieg....@googlemail.com on 3 Jul 2009 at 3:16