[osg-submissions] DDS cubemap support

Smeenk, R.J.M. (Roland) roland.smeenk at tno.nl
Thu Sep 27 23:24:45 PDT 2007


A couple of weeks ago I decided to make a minor modification to the dds
reader for supporting cubemaps.
This quickly turned into a somewhat larger modification than I expected.

Here's a list of the things I changed:

-osg::Image                        Supports for multiple data faces
(including possible mipmaps)
-osg::Texturecubemap     Collapsed image array inside into a single
image with 6 faces
-osg::Texture                     Added face as parameter to apply
methods
-osgUtil::cubemapgenerator   Now using single 6 face image
-osgFX::specularhighlights    Now using single 6 face image

-dds plugin
    -loading a cubemap into an 6 face image
    -writing a 6 face image as cubemap

-osg plugin
    -loading new style cubemaps
    -loading old style cubemaps with automatic conversion to new style
cubemap
    -writing new style cubemaps

-ive plugin
    -loading new style cubemaps
    -loading old style cubemaps with automatic conversion to new style
cubemap
    -writing new style cubemaps

-osgcubemap example             Now using a single 6 face image
-osgvertexprogram example    Now using a single 6 face image

I tried to keep the impact of the interface changes a low as possible by
using default parameters. However this is dangerous in some cases. This
is especially the case with osg::Image::data() which exists in two
variants:
inline unsigned char* data(unsigned int face)
inline unsigned char* data(int column, int row=0, int image=0, unsigned
int face=0)

For accessing specific face data you will have to explicitly set it to
an unsigned int to end up using the correct method.
unsigned char* facedata = data((unsigned int)2);

Possible future additions related to these changes are:
-Convert TextureArray to using a multiple face image, but there exists
no multiface image format that I know of.
-.hdr loader support for cubemap loading/writing
-Cubemapgenerator for converting a cross image into a cubemap (with
configurable face layout)

kind regards,

Roland Smeenk

 


This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/disclaimer/email.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20070928/40fa7e93/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ddscubemap.zip
Type: application/x-zip-compressed
Size: 66459 bytes
Desc: ddscubemap.zip
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20070928/40fa7e93/attachment-0001.bin 


More information about the osg-submissions mailing list