[osg-users] Preload textures in graphics card
robert.osfield at gmail.com
Thu Nov 12 03:34:38 PST 2009
The OSG already pre compiles textures when the graphics context is
realized as long as you've assigned the scene graph prior to realizing
the windows. If you load and assign the scene graph afterwards then
you'll need to do a precompile step then, but if you already using the
PagedLOD and the DatabasePager it'll already be doing this pre-compile
step for you. My guess is that this precompile is already done so
redoing won't make any difference.
Now, there is more to keeping textures resident than just compiling
them, and there more to avoiding frame drops that compiling textures,
so... there is a lot left to look into to fix the frame drops. I
know practically nothing about how you've composed your scene graph or
your hardware so I can't add very much about what to look into next.
On Thu, Nov 12, 2009 at 10:07 AM, Joseba Rodriguez
<jrodriguez at landersimulation.com> wrote:
> 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:
> osg-users mailing list
> osg-users at lists.openscenegraph.org
More information about the osg-users