Re: [osg-users] How to load different tga files in a smoothly way like a movie

2008-04-02 Thread Stephan Huber
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


Re: [osg-users] How to load different tga files in a smoothly way like a movie

2008-04-02 Thread Robert Osfield
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


Re: [osg-users] How to load different tga files in a smoothly way like a movie

2008-04-02 Thread digitcodecpp
-- Initial Header ---

From  : [EMAIL PROTECTED]
To  : OpenSceneGraph Users osg-users@lists.openscenegraph.org
Cc  : 
Date  : Wed, 2 Apr 2008 09:31:37 +0100
Subject : Re: [osg-users] How to load different tga files in a smoothly way 
like a movie

Hi bobby lobby (just a likely a name ...I presume this is fine ;-) like Umpa 
Lumpa) 
As you know, what you are planning to do next summer is what we are going to 
realize in our building. :)
Where i will find Quicktime and Xine-lib plugins?
thanks

 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
 

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


Re: [osg-users] How to load different tga files in a smoothly way like a movie

2008-04-02 Thread J.P. Delport
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


Re: [osg-users] How to load different tga files in a smoothly way like a movie

2008-04-02 Thread Robert Osfield
Hi Umpa, it's ok to call you Umpa isn't it? :-)

On Wed, Apr 2, 2008 at 10:19 AM, digitcodecpp [EMAIL PROTECTED] wrote:
  Hi bobby lobby (just a likely a name ...I presume this is fine ;-) like Umpa 
 Lumpa)
  As you know, what you are planning to do next summer is what we are going to 
 realize in our building. :)
  Where i will find Quicktime and Xine-lib plugins?

There plugins are in src/osgPlugins/quicktime and src/osgPlugins/xine
respectively.  There should both be in OSG-1.2, but in 1.2 the
quicktime plugin only works under OSX.  The xine plugin only works
under unix but in theory could be ported to Windows as there have been
xine ports.

The xine plugin is far simpler than the Quicktime plugin so if you
want a code reference then it'll be the one to look at.

Bobby Lobotomy
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to load different tga files in a smoothly way like a movie

2008-04-02 Thread digitcodecpp
-- Initial Header ---

From  : [EMAIL PROTECTED]
To  : OpenSceneGraph Users osg-users@lists.openscenegraph.org
Cc  : 
Date  : Wed, 2 Apr 2008 10:50:02 +0100
Subject : Re: [osg-users] How to load different tga files in a smoothly way 
like a movie


Its pretty ok for UMBA ;)
I will try with xine plugin and also with other suggets about my issue. I will 
post result as soon as possible.
Thank.




 Hi Umpa, it's ok to call you Umpa isn't it? :-)
 
 On Wed, Apr 2, 2008 at 10:19 AM, digitcodecpp [EMAIL PROTECTED] wrote:
   Hi bobby lobby (just a likely a name ...I presume this is fine ;-) like 
  Umpa Lumpa)
   As you know, what you are planning to do next summer is what we are going 
  to realize in our building. :)
   Where i will find Quicktime and Xine-lib plugins?
 
 There plugins are in src/osgPlugins/quicktime and src/osgPlugins/xine
 respectively.  There should both be in OSG-1.2, but in 1.2 the
 quicktime plugin only works under OSX.  The xine plugin only works
 under unix but in theory could be ported to Windows as there have been
 xine ports.
 
 The xine plugin is far simpler than the Quicktime plugin so if you
 want a code reference then it'll be the one to look at.
 
 Bobby Lobotomy
 ___
 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