Summary:
Do not use dxt3 or dxt5 for models in Celestia
dxt1 is OK.
linuxm@n wrote:hello Selden
I tried yesterday different command with nvidia nvdxt utilities like this one or others:
wine nvdxt -file atpir2.jpg -dxt5 -alpha -aclear -rescale -gamma -outdir
But picture are transparent.... (the wine command emulate windows on linux)
I have also tried DDS converter 2 and i don't find a place to specify that the alpha channel is white
With The Gimp i have a plugin to use dds picture and i don't f find
more solution.
The white alpha channel must be specified then i create the picture with Gimp ?
Linuxman
I'm sorry about the delay in getting back to you.
According to the help text which I get when I type only
nvdxt
-aclear : store 0.0 in alpha channel
-awhite : store 1.0 in alpha channel
0.0 = black = transparent
so you should use
-awhite
but I get a translucent texture when I do that, too. I think it must be a bug in nvdxt.
However, nvdxt makes opaque textures for me when I create a DXT5 texture from a .TGA file which already contains a white alpha channel.
I use ImageMagick's convert under Windows to manipulate images. I use the 8bit version of ImageMagick to ensure compatibility with Celestia.
Code: Select all
# create tga image with alpha channel
#use white image file as alpha channel for surface texture image
convert white_2k.ppm metallic96.jpg +matte -compose CopyOpacity -composite metallic96.tga
# create metallic96.dds
nvdxt -file metallic96.tga -dxt5
[edit]
This is very strange.
It is now failing for me.
DXT5 and DXT3 textures are always translucent when converting from tga with a white alpha channel. I even tried an older version of nvdxt (8.22) and it fails, too.
However,
I get an opaque dxt5 texture if I convert directly from jpg to dxt5 with the command
Code: Select all
nvdxt -file metallic96_mine.jpg -output metallic96.dds -dxt5
I get an opaque dxt5 texture if I convert the jpg to png and then to dds with the commands
Code: Select all
convert metallic96_mine.jpg metallic96_mine.png
nvdxt -file metallic96_mine.png -output metallic96.dds -dxt5
So, nvdxt seems to do the right thing if the original image has no alpha channel and you do not tell nvdxt to do anything about the alpha channel. In other words:
Do not use the either of the qualifiers -aclear or -awhite.
[edit #2]
Oh, this is nasty.
Apparently dxt5 does have transparency set, even though it's opaque.
This breaks depth sorting in both Celestia v1.6 and Celestia v1.5.1.
Here is a picture of a torus using a png surface texture. It looks fine.
Here is a picture of a torus using the dxt5 surface texture created from the png image. It is broken. It is opaque, but it is drawn wrong.
Note that this depth sorting problem is seen in both v1.5.1 and v1.6.
Result: do not use dxt3 or dxt5 for models in Celestia