Hi Robert,
I hope I do not spread misinformation, as I am not fully sure nor I know
exact details but I believe that logic for finding if DXT1 pixels are
transparent, should first check the order of entries in chunk( 4x4pixels)
micropallete. And if its ascending then chunk may not contain alpha pixels
and if its descending chunk may contain such pixels and then we should look
for proper alpha pixel index. That information comes from top of my head,
I cannot at the moment delve deeper and look into verifying this but thats
what I remember I read somewhere...
Cheers,
Wojtek Lewandowski
-----Oryginalna wiadomość-----
From: Robert Osfield
Sent: Thursday, April 14, 2011 1:03 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] DDS with DXT1 with and without alpha
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.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org