Hi guys,
my goal is to create an application that load different .tga files in a
sequence like a movie.
To do that, i have created a geometry that will contain all the textures
(images). First of all, i load all images file, using :
mImageTexture = new osg::Texture2D;
typedef osg::Image* _IMAGES;
std::vector<_IMAGES> mImgFaceArray;
osg::StateSet* mStateOne;
... a loop to load different .tga file (myfile_000k.tga . where k is between
0...1000 with 720x576 resolution) in mImgFaceArray.
Then, i use StateSet :
mStateOne->setTextureAttributeAndModes(0,mImageTexture,osg::StateAttribute::ON);
mStateOne->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
Once i have load all images, in a method that i call continuosly i'm using:
....
mImageTexture.get()->setDataVariance(osg::Object::DYNAMIC);
mImageTexture.get()->setResizeNonPowerOfTwoHint(false);
mImageTexture.get()->setImage(mImgFaceArray.at(imageIndexArray));
....
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?
I'm using openscenegraph 1.2.
Thank in advance.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org