Hi Ben,

we also pump data from cameras into the GPU. To enable PBOs is simple:

// make image
osg::ref_ptr<osg::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)
myim->setImage(ImageFormat_[i].getWidth(),

ImageFormat_[i].getHeight(),
1, 1, GL_LUMINANCE, GL_UNSIGNED_BYTE,
                                                          my_data_pointer,

osg::Image::NO_DELETE);

// assign to texture
mytexture->setImage(myim.get());

Now, when the data update, just call myim->dirty() and all should update. You can also call setImage again.

jp

Ben Cain wrote:
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 <[email protected]> wrote:
You might try using PBOs (pixel buffer objects).  I think the
osgscreencapture example shows them in action.

_______________________________________________
osg-users mailing list
[email protected]
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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to