[osg-users] Textures and Images

Jason Jerald jason at digitalartforms.com
Mon Nov 2 10:30:56 PST 2009


I recently had similar issues.  There are multiple ways to store textures in
the model.  You can convert your model to .osg format and look to see how
the textures are stored in your model.  And/or have your code try all the
possibilities until you no longer get NULL.

Jason






-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Julian
Looser
Sent: Sunday, November 01, 2009 1:16 PM
To: osg-users at lists.openscenegraph.org
Subject: [osg-users] Textures and Images

Hi,

I have a question about osg::Textures. In my program I load an IVE file with
embedded textures. Once it is loaded, I traverse the subgraph with a custom
visitor which inspects each osg::StateSet. I find osg::Textures within these
statesets, and I want to get the filenames for the images the textures are
using.

I thought I had this working as a bunch of test models loaded and were
analysed correctly. However, for some models, the textures are found, but if
I call getImage(n) on the texture, NULL is returned. The texture looks fine
in the viewer, so I know the image data has been loaded at some point.

Shouldn't an osg::Texture loaded from an image file always have a valid
osg::Image you can access?

Why would this work for some models and not others? Is it a difference in
the loaders for different image formats?

Cheers,
Julian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18997#18997





_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list