Hi Umpa Lumpa (just a likely a name as digitcodecpp so I presume this
is fine ;-)

The best guide is the existing Quicktime and Xine-lib plugins, they
both run a background thread for the movies stream and subclass from
osg::ImageStream.  ImageStream by default constructs a
PixelBufferObject which helps immensly with stream data to textures.
osg::Texture* itself supports texture subloading, but I'm not sure if
1.2 requires you to reuse the same osg::Image/ImageStream rather than
applying a separate osg::Image on each update.

It just so happens for my future work on Present3D due later this
Spring and through the summer I plan to write a movie class that
enables streaming of movies form standard image formats, this is
something I would integrate into the core OSG.  The motivation is the
ability to use non standard video dimensions and full RGBA or
intensity data streams.  It also opens the possibility of stream 3D
textures as well.

Robert.

On Wed, Apr 2, 2008 at 8:03 AM, digitcodecpp <[EMAIL PROTECTED]> 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
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to