I've notice that a lot people have problems to use Nvidea's nvdxt commandline tool. Therefore I will try to explain it a bit. I'd used for my examples the version 6.54 of nvdxt.
You get this tools here: http://developer.nvidia.com/object/nv_t ... tools.html
There is also a useful html documentation.
What can nvdxt do for Celestia?
1. It convert textures to DDS format,
- input formats: tga, bmp, gif, ppm, jpg, tif, cel, dds ,png ,psd
but these formats was tested:
- - jpg: works only with '-swap' correct
- png: only the 32bit format (with alpha) and with '-swap' works correct (common tools like Irfanview save only 24bit png's!)
- tif: 24/32bit works (with and without alpha)
- tga: 24/32bit works (with and without alpha)
- - dxt1a : 1bit alpha, fewer colors than dxt1c
- dxt1c : use same compression as dxt3/5 but no alpha channel, all Nvidea cards show this with less colors because of a bug!
- dxt3 : 4bit uncompressed alpha channel that means only 16 level!
- dxt5 : compressed alpha channel allows 256 levels (theoretical 1792)
- u888 : a simple uncompressed 24 bit RGB picture with 8bit per channel
- u8888 : 32bit RGBA picture, includes 8bit alpha Channel
2. generates and filters mip maps,
3. does batch processing, extrem useful for virtual textures !
Now a list of useful parameters (there is no order):
- -file: input file to process. Accepts wild cards
-deep [directory]: include all subdirectories
-outdir : output directory
-outsamedir : output directory same as input
-nomipmap : don't generate MIP maps (use with virtual textures)
-Cubic : create MIP maps with cubic filtering (use always except for VT's (there are a lote more filters but 'Cubic' is the best compromise of performence and quality)
-dither : add dithering (smoother colors but adds noise !)
-swap : swap rgb (must be used with jpg and png images because of a bug)
the switch for the output format:
-dxt1a ( only for special cases e.g. earth country borders )
-24 dxt1c ( for textures without alpha, but on Nvidea hardware with reduced colors)
-dxt3 ( best format without alpha (black alpha) on Nvidea hardware)
-dxt5 ( the best format for textures with alpha channel)
-u888 (useful for high quality normal maps)
-u8888 ( only for "hifi" freaks, very large files on disc and memory )
There are many more parameters of nvdxt. Further it's possible to build normal maps but only from 8bit bump maps.
Examples: (of course the dimensions of all input files must be power of two)
nvdxt -file jupiter2k.jpg -swap -Cubic -24 dxt1c
- build a dxt1c dds file with mipmaps
- the mipmaps are build with cubic resample,
- the '-swap' switch corrects a bug of nvdxt concern all 'jpg' and 'png' files
nvdxt -file earth-clouds.png -swap -Cubic -dxt5
- build a dxt5 dds file with alpha (transparency) information and mipmaps
- the input png file must be 32bit (24bit color + 8 bit alpha channel)
- the '-swap' switch corrects a bug of nvdxt concern all 'jpg' and 'png' files
nvdxt -file tx_*.jpg -swap -deep -outsamedir -nomipmap -24 dxt1c
- this example shall show how all 'jpg' tiles of complete virtual texture can be converted to dds dxt1c
- place nvdxt and the bat file in front of the level folders
nvdxt -file tx_*.tga -deep -outsamedir -nomipmap -u888
(you have a nice normal map and has build the tiles for a VT in tga format)
- this example shows how all tiles of a VT in tga format can be converted to dds u888
tips:
- Copy 'nvdxt.exe' always to the place where your texture is.
- Build there a little 'bat' file with your nvdxt command.
- A 'bat' file can be build and edited with Notpad. To create such a file save it with the extension 'bat' instead of 'txt'. If you have still problems send greetings to MS and thanks for hideing file extensions by default.
- Start the conversion with double click on your 'bat' file.
- Nvdxt works very fast if no mipmaps are generated and compress always with a good quality.
Sorry all Linux or Mac user this is (win)DOS only. Maybe a dos emulator works on your sytem?
Bye Jens