digitcodecpp schrieb:
> to change textures at 30 fps.
> But, when new image is load, there is a delay that prevent application to run 
> smoothly like a movie.
> I tryed it also with .jpg files, but i get the same delay when i load a new 
> texture.
> I tryed also to use osg::TextureRectangle instead osg::Texture2D, but in this 
> case i don't see the texture.
> Could anyone give me any suggest about?

Check the console if your images get scaled to POT when uploaded to the
graphics card. If that's the case, this is the main-cause of your
slowdown. Try using TextureRectangles (you'll need absolute tex-coords
for that)

Try subloading your images: create a placeholder image, attach this
placeholder image as texture to your geometry, and copy subsequent
tga-frames into this placeholder image and dirty the placeholder image.
subloading should be much faster than replacing textures.


You can get it even more faster (but difficulter to code): use a second
thread which holds a shared context, use a pool of textures which are
bound to both contexts and a corresponding pool of images, only one
texture is visibly bound to your geometry, so now you can fill in the
second thread the other textures with images and swap the textures via
an update-callback to show new uploaded frames. I hope you'll get the idea.

Or convert your images into a .mov and play it via the quicktime-plugin ;-)

hth,
Stephan

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

Reply via email to