How to Create .DDS Files That Work in Uniview

I am attempting to create a module which displays a DDS file. However, when I save out a file as a 4096x4096 or 1024x1024 .DDS image using XnView is causes Uniview to crash. This leads me to believe that it needs to be saved out in a different "flavor" of DDS. Are the specific DDS settings and/or a different piece of SW I should be using? I tested my theory by re-saving a working module DDS file from using XnView. It also caused UV to crash.

Thanks!

Joel

Intermediate

Is this article helpful for you?

I usually use GIMP 2.0 but the big issue with Uniview is the compression of the DDS image. YOu need to make sure you use the BC1/DXT1 compression when you save out the DDS image. I am not sure what the options are with XnView but that seems to work for me.

I figured it out, so I will attempt to answer my own question for the benefit of others. Here's what I know:

DDS (DirectDraw Surface) is a file format which can be decompressed in hardware by GPUs. The compression can be handled in a number of ways. For DirectX applications it is handled as DXT (for DirectX Texture compression). For this there are three types: DXT1, DXT3 and DXT5. Uniview DDS files are stored as type DXT3. XnView stores files as DXT5. Based on the chart below, I think the problem occurs in how UV handles the alpha channel. (just my guess)

DXT3
ARGB, 8 bpp, explicit alpha

DXT3 is a fixed 4:1 compression ratio.

It has 8-bit alpha, but the way it is compressed does not give good interpolation results, which makes banding apparent. It is rarely used, use DXT5 instead.

DXT5

ARGB, 8 bpp, interpolated alpha

DXT5 is same 4:1 compression ratio as DXT3.

It's 8-bit alpha is interpolated, which yields much smoother results.


I ended up using the NVIDIA Texture Tools for Adobe Photoshop to do the job.

https://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop

This plugin supports saving in a variety DDS compression schemes, including DXT3. This seems to have cleared up the problem.


To add to that list, Uniview also supports DXT1. If not using alpha quality is same as DXT3, but with alpha DXT3 and DXT5 is better.


DXT1

RGB(A), 8 bpp, 1bit alpha

For RGB compression is fixed 6:1

WIth 1bit alpha compression is 4:1


Answered

Uniview supports compressed DDS texture in DXT1, DXT3 and DXT5 formats. 

Recommendation is not to use DXT1 with 1bit alpha since it will degrade color if used, so use DXT1 for color only texture and DXT3,DXT5 for texture with alpha.


DXT1

RGB(A), 8 bpp, 1bit alpha

For RGB compression is fixed 6:1

WIth 1bit alpha compression is 4:1



DXT3
ARGB, 8 bpp, explicit alpha

DXT3 is a fixed 4:1 compression ratio.

It has 8-bit alpha, but the way it is compressed does not give good interpolation results, which makes banding apparent. It is rarely used, use DXT5 instead.


DXT5

ARGB, 8 bpp, interpolated alpha

DXT5 is same 4:1 compression ratio as DXT3.

It's 8-bit alpha is interpolated, which yields much smoother results. 


Tools

Nvidia Photoshop plugin

Nvidia command line tool

GIMP 2.0 w dds plugin


Thank you Joel and Greg for the information.

Hi Urban, Can you confirm DXT5 support in UV? My first attempts at DDS files failed and I assumed it was due to the fact that they were saved as DXT5 files. These same files worked when I saved them as DXT3.


Thanks,

Joel

Yes, DXT5 is there... I did a quick and dirty test(on newer code than 1.5.6, but that code hasn't changed so I am fairly confident it should work in 1.5 aswell) with nvcompress.exe from the Nvidia command line tools, both DXT3,DXT5 with alpha worked compressed from a .tga image:


nvcompress.exe -alpha -bc3 <src>.tga <destination>.dds
nvcompress.exe -alpha -bc2 <src>.tga <destination>.dds

Do you have a specific file or workflow that is not working? 

Answer
Answered

Uniview supports compressed DDS texture in DXT1, DXT3 and DXT5 formats.
Recommendation is not to use DXT1 with 1bit alpha since it will degrade color if used, so use DXT1 for color only texture and DXT3,DXT5 for texture with alpha.



DXT1
Compress each block of 16 pixels into 64 bits. Additionally, it is composed of two different 16-bit RGB 5:8:5 color values and a 4x4 2-bit lookup table.
RGB(A)
For RGB compression is fixed 6:1
WIth 1bit alpha compression is 4:1



DXT3
DXT3 converts each block of 16 pixels into 128 bits and is composed of 64 bits of alpha channel data and 64 bits of color data.
ARGB, 8 bpp, explicit alpha.
DXT3 is a fixed 4:1 compression ratio.
It has 8-bit alpha, but the way it is compressed does not give good interpolation results, which makes banding apparent. DXT3 is a good format choice for images or textures with sharp alpha transitions (opaque versus translucent).


DXT5
DXT5 converts each block of 16 pixels into 128 bits and is composed of 64 bits of alpha channel data and 64 bits of color data.
ARGB, 8 bpp, interpolated alpha
DXT5 is same 4:1 compression ratio as DXT3.
It's 8-bit alpha is interpolated. DXT5 is a good format choice for images or textures with gradient alpha transitions.




Tools
Nvidia Photoshop plugin
Nvidia command line tools
GIMP 2.0 w dds plugin

PVRTexTool


Thank you Joel and Greg for the information.

Urban,


So I did a test. Yes, DTX5 works when I use the NVidia plugin for PS. However, when I use XnView to save as DDS it crashes. So something does not work with DXT5 version of DDS with XnView . Since XnView does not have DDS options, It's hard to ID where the problem lies. When I view the file in Hex mode, I do see it is designated as a DXT5 file. So, not sure where the problem lies. Simple answer: avoid XnView for DDS file creation!

Thanks,

Joel

Ok, if you share that DDS that makes UV crash we could get support to look at it. Either attach it to this thread, add a link or send an email to support@sciss.se.


It could be that it has some problems with mipmaps, the nv command line tools generate them by default and maybe the XnView doesn't.

PINNED

XnView does not generate a correct DDS header. So Uniview cannot load the DDS generated. So our recommendation is to not use XnView to save to DDS.

And that is why I recommend GIMP :)

It is worth noting that you must make sure that you save the DDS files with a complete set of mipmaps.