[osg-users] DDS with DXT1 with and without alpha

Robert Osfield robert.osfield at gmail.com
Thu Apr 14 04:03:31 PDT 2011

Hi All,

I have now implemented the various options I suggested in my previous
post, and for now have opted to default to  DXT1 RGB pixle format for
DXT1 files, unless the alpha bit in the dds header is set, then it
will choose DXT1 RGBA pixel format.  The OSG's DDS plugin does set the
alpha bit when writting out DXT1 RGBA images, but other 3rd party
tools such as nvcompress do not, so for these 3rd party generated
images the dds plugin will now read all these DXT1 files as RGB.
These changes are now checked into svn/trunk.

You can list the new options using:

> osgconv --format dds

Which will output:

Plugin osgPlugins-2.9.12/osgdb_dds.so
    ReaderWriter : DDS Image Reader/Writer
        features   : readObject readImage writeObject writeImage
        extensions : .dds                    DDS image format
        options    : dds_dxt1_detect_rgba    For DXT1 encode images
set the pixel format according to presence of transparent pixels
        options    : dds_dxt1_rgb            Set the pixel format of
DXT1 encoded images to be RGB variant of DXT1
        options    : dds_dxt1_rgba           Set the pixel format of
DXT1 encoded images to be RGBA variant of DXT1
        options    : dds_flip                Flip the image about the
horizontl axis

To get the old automatic detection of DXT1 RGB vs RGBA you'll need to
use the "dds_dxt1_detect_rgba" option string.

I've gone for the default what I feel is probably most approrpiate,
but am aware I don't regularily use DXT1 compressed data coming in
from 3rd party sources in my work, so you own art parth routes may be
quite different.  Please chip in.


More information about the osg-users mailing list