[osg-users] Textures and Images

Julian Looser julian.looser at hitlabnz.org
Sun Nov 1 13:16:06 PST 2009


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?


Read this topic online here:

More information about the osg-users mailing list