OpenSceneGraph: texture missing – The Solutions

11 Mar

After developing a program using OSG, you might sooner or later package all needed executable (*.exe, *.dll) and copy/deploy them to the target machines.

It is not uncommon that when you open a model, e.g. OBJ, 3DS, FLT files, all works right, except for the textures, missing!


image    image

There might be multiple reasons for this missing textures:

  • Have you included the TIFF, PNG, JPEG plugins when compiling the OSG source code? If not, include them in the cmake file;
  • Make sure the texture images (e.g. *.tiff, *.png) is linked in the right path. For instance, when you open an object file, there might be an accompanying MTL file, which you can open with Notepad or other text editors to see which image is used as the textures
  • Try to use other model viewers, such as Blender, Maya or ClockStone FBX Viewer etc. to verify that the models themselves are no problem.

Yes, you did everything, otherwise you won’t read this blog, Smile, but the problem is, it still doesn’t work.

To troubleshoot this, a good way is to use osgviewer command line utility, which is in the bin\ folder of the OSG directory:

osgviewer.exe C:\SomeDir\Crazy.obj

When you run that, some errors might popup, and this is an opportunity to diagnose where is wrong! Lovely!


In the above example, the libtiff.dll cannot be found. You can locate this dll in your development machine, and copy it to the same folder as your exe file on the target machine, or simply copy this dll to the windows\system32\ folder of the target machine. Done!

Thanks God. Finally we made it!

Leave a comment

Posted by on March 11, 2014 in osg, Programming


Tags: , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: