Re: [osg-users] Rapidly updating texture data

2010-03-04 Thread Robert Osfield
Hi Jason and David, On Wed, Mar 3, 2010 at 10:09 PM, Jason Daly jd...@ist.ucf.edu wrote: Yeah, Performer wasn't written for OpenGL 2.0. OSG wasn't originally either, which is why it defaults to resizing all images. The resize hint was added for OpenGL 2.0 (actually for the

Re: [osg-users] Rapidly updating texture data

2010-03-03 Thread David Glenn
J.P. Delport wrote: Hi Ben, I'm not sure if you are still scaling the image... If you are using Texture2D you can call texture-setResizeNonPowerOfTwoHint(false); on them to do not scale before uploading. Modern GPU are quite OK with non power of two textures. You can also use

Re: [osg-users] Rapidly updating texture data

2010-03-03 Thread Jason Daly
David Glenn wrote: Sounds interesting! I assume that using TextureRectangle does not auto-resize the image file like Texture2D does? Both Texture2D and TextureRectangle can work with non-power of two textures, if your graphics hardware supports it. Every OpenGL 2.0-compatible graphics

Re: [osg-users] Rapidly updating texture data

2010-03-03 Thread Ben Cain
Yep, now I can use the full camera resolution of 1024x768. I knew OpenGL 2.x could handle non-power of two textures ... didn't realize it was possible to circumvent the resize. Thanks much Jason. Kudos! On 3/3/10, Jason Daly jd...@ist.ucf.edu wrote: Both Texture2D and TextureRectangle can

Re: [osg-users] Rapidly updating texture data

2010-03-03 Thread David Glenn
Jason Daly wrote: David Glenn wrote: Both Texture2D and TextureRectangle can work with non-power of two textures, if your graphics hardware supports it. Every OpenGL 2.0-compatible graphics card should handle this without a problem. The main difference with TextureRectangle is that it

Re: [osg-users] Rapidly updating texture data

2010-03-03 Thread Jason Daly
David Glenn wrote: Funny thing J, for what it's worth, the Performer code still gives me the Magic Number Error if I feed it any texture that is wrong and I know I'm using OpenGL 2.0. So I thought in that case it was a performer thing. Well I’m talking about 5+ year old code at best, that was

Re: [osg-users] Rapidly updating texture data

2010-03-02 Thread Ben Cain
Oh my goodness ... did something really stupid. I was taking the camera image which is a non-power-of-2 (1024x768). It had to be scaled down to 1024x512. Doh! It's working quite well now. On 3/2/10, J.P. Delport jpdelp...@csir.co.za wrote: Hi Ben, I rechecked our code and we are using

Re: [osg-users] Rapidly updating texture data

2010-03-02 Thread David Glenn
Ben Cain wrote: Oh my goodness ... did something really stupid. I was taking the camera image which is a non-power-of-2 (1024x768). It had to be scaled down to 1024x512. Doh! It's working quite well now. On 3/2/10, J.P. Delport wrote:

Re: [osg-users] Rapidly updating texture data

2010-03-02 Thread J.P. Delport
Hi Ben, Ben Cain wrote: Oh my goodness ... did something really stupid. I was taking the camera image which is a non-power-of-2 (1024x768). It had to be scaled down to 1024x512. I'm not sure if you are still scaling the image... If you are using Texture2D you can call

Re: [osg-users] Rapidly updating texture data

2010-03-01 Thread Ben Cain
Thanks J.P. You say that I can call myim-dirty() or myim-setImage(), but wouldn't calling myim-setImage() cause a slow update? That's what I seem to be experiencing. I need to update based on the sensor around 30Hz. The imagery data (from sensor) is in system memory ... just trying to get a

Re: [osg-users] Rapidly updating texture data

2010-03-01 Thread J.P. Delport
Hi Ben, Ben Cain wrote: Thanks J.P. You say that I can call myim-dirty() or myim-setImage(), but wouldn't calling myim-setImage() cause a slow update? That's what I seem to be experiencing. I need to update based on the sensor around 30Hz. I rechecked our code and we are using setImage

Re: [osg-users] Rapidly updating texture data

2010-02-25 Thread Jason Daly
Ben Cain wrote: Hello, Is there a way to repeatedly/efficiently update an OSG texture's data ... for example imagery data that is being updating in system memory (e.g. from a sensor capture device). I've tried updating an OSG texture using texture2D-setImage(data) ... but it is very slow.

Re: [osg-users] Rapidly updating texture data

2010-02-25 Thread Ben Cain
Thanks Jason. I've used FBOs before for render-to-texture. I'll take a look at PBOs. On Thu, Feb 25, 2010 at 3:05 PM, Jason Daly jd...@ist.ucf.edu wrote: You might try using PBOs (pixel buffer objects).  I think the osgscreencapture example shows them in action.

Re: [osg-users] Rapidly updating texture data

2010-02-25 Thread Jason Daly
Ben Cain wrote: Thanks Jason. I've used FBOs before for render-to-texture. I'll take a look at PBOs. No problem. There's also the osg::ImageStream class. It's subclassed in the ffmpeg plugin and used in the osgmovie example for streaming movies to texture. If you've got an image

Re: [osg-users] Rapidly updating texture data

2010-02-25 Thread J.P. Delport
Hi Ben, we also pump data from cameras into the GPU. To enable PBOs is simple: // make image osg::ref_ptrosg::Image myim = new osg::Image(); // attach pbo myim-setPixelBufferObject(new osg::PixelBufferObject(myim.get())); // point im to data, avoid copying (mod format here for your app)