[osg-users] Custom mipmap loading? (Re: Texture not clear in far view)

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Mon Sep 8 19:25:37 PDT 2008


Hi Ulrich,

> Is the use of DDS files the only way to use custom mipmap images?
> If so what's a good tool to author custom mipmap DDS files (or any DDS file for that
> matter) on Linux and/or OS X?

As far as I know, it's the only widely accepted format that has this 
functionality for textures (GeoTiff has a similar feature for height 
fields, if I'm not mistaken).

But beyond having mipmaps embedded in the image, DDS is also a great 
format for textures in its own right. For one thing, they are compressed 
but do not require decompression before being used as a texture in 
OpenGL as most video cards and drivers (OpenGL and DirectX) support them 
natively.

If you use a JPEG compressed file as a texture, the file needs to be 
decompressed and uploaded into video memory that way, so it takes more 
texture memory. DDS files can be sent to the card in compressed form 
directly and the card will use them directly, saving texture memory for 
the same size/quality textures. The file size on disk will perhaps be 
larger than the same image in JPEG, but the texture memory savings are 
significant.

There is a Photoshop plugin to save DDS files, but I'm not sure what the 
workflow in Photoshop works for saving mipmaps into the DDS file... Plus 
you specified Linux, so Photoshop won't work for you.

Here's the DDS plugin for the GIMP:
http://nifelheim.dyndns.org/~cocidius/dds/
Seems pretty complete. It says it can do automatic mipmap generation on 
save, I hope it gives you options on which filtering algorithms to 
use... It also says it can load mipmap levels onto separate layers, I 
wonder if it can save mipmap levels that are on separate layers too... 
That would be the best.

On Win32, there's a tool that allows you to create and manipulate DDS 
files in the DirectX SDK.
ATI/AMD also has the Compressonator which allows you to work with them.
http://developer.amd.com/gpu/compressonator/Pages/default.aspx

I'm sure a quick web search will give even more possibilities for Linux. 
I don't use Linux regularly (just once in a while to test that my coding 
is cross-platform) so I can't really suggest more than that.

> I was recently asked if it's possible to use individual files and had to conclude (after a
> browse through the code) that it's not possible.  Would it make sense to add that
> functionality?  Kind of like an Image that contains Images?

That would be cool, true. Perhaps a pseudo-loader could be created that 
would do this...

Hope this helps,

J-S
-- 
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com
                                http://www.cm-labs.com/
                         http://whitestar02.webhop.org/



More information about the osg-users mailing list