Hi,

you could also try enable pixel buffer objects on the textures you are 
pushing to the GPU.

See the call that looks like e.g.
VideoImage[i]->setImage(cameraImageWidth, cameraImageHeight, 1, 1, 
GL_LUMINANCE, GL_UNSIGNED_BYTE, gImage[i], osg::Image::NO_DELETE);              
_VideoImage[i]->setPixelBufferObject(new 
osg::PixelBufferObject(_VideoImage[i].get()));

cheers
jp

digitcodecpp wrote:
> 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
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.

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

Reply via email to