[osg-users] Preload textures in graphics card

Joseba Rodriguez jrodriguez at landersimulation.com
Thu Nov 12 02:07:15 PST 2009


I have some big scenes (just one ive file each one). After the viewer is initialized i load one of these scenes (imagine a long road with curves) and i make the camera go along a path. 
The problem is that i notice some frame drops (peaks, mainly in curves, when new geometry comes in view). When i make a second pass, this frame drops disappear. I also used a small app for testing graphics memory and i saw that in these peaks, graphics memory usagge grows, so i guess that the main problem are textures being loaded in graphics card.

Looking in the forum I found some interesting threads about using GLObjectVisitor, but this didnt solve the problem. I dont know if i did something wrong or just this was not the solution:

struct CompileCallback : public osg::Camera::DrawCallback 
	virtual void operator() (const osg::Camera& camera)
		osgUtil::GLObjectsVisitor gov; 

view->getCamera()->setPreDrawCallback(new CompileCallback);

I also tried a solution given in this post:

viewer->setIncrementalCompileOperation(new osgUtil::IncrementalCompileOperation());

After viewer initialization (and before loadint the scene). The results where just the same.

Is there any way to preload textures in graphics card? Any other sugestion?

Thank you!


Read this topic online here:

More information about the osg-users mailing list