[osg-users] frequently modified osg::Image uploads
Hi Community, I have a case where I work with osg::Image on the CPU and uploading it to a osg::Texture object. However, it is terribly slow - the osg::Image is modified on each frame. Any hints techniques for this tip of task? Thanks a bunch as always! Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Hi Trajce, Hi Community, I have a case where I work with osg::Image on the CPU and uploading it to a osg::Texture object. However, it is terribly slow - the osg::Image is modified on each frame. Any hints techniques for this tip of task? 1. Make sure it is not resized during upload (NPOT) 2. If possible try to keep it on the GPU. I.e. try to move your CPU-algorithm to the GPU. Cheers Sebastian Thanks a bunch as always! Nick -- trajce nikolov nick ___ 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] frequently modified osg::Image uploads
Hi Sebastian, it is TextureRectangle so NPOT is not an issue. Also, I am using the osg::Image for transfer of data from the CPU to the GPU, so it is not possible to have it all in the GPU. Thanks anyway though! Nick On Wed, Oct 29, 2014 at 12:10 PM, Sebastian Messerschmidt sebastian.messerschm...@gmx.de wrote: Hi Trajce, Hi Community, I have a case where I work with osg::Image on the CPU and uploading it to a osg::Texture object. However, it is terribly slow - the osg::Image is modified on each frame. Any hints techniques for this tip of task? 1. Make sure it is not resized during upload (NPOT) 2. If possible try to keep it on the GPU. I.e. try to move your CPU-algorithm to the GPU. Cheers Sebastian Thanks a bunch as always! Nick -- trajce nikolov nick ___ osg-users mailing listosg-users@lists.openscenegraph.orghttp://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 -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Hi Nick, On 29 October 2014 11:14, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: it is TextureRectangle so NPOT is not an issue. Also, I am using the osg::Image for transfer of data from the CPU to the GPU, so it is not possible to have it all in the GPU. Thanks anyway though! Assign an osg::PixelBufferObject to the osg::Image to assist with the data transfer. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Hi Nick, Make sure that it actually is the image transfer which is the culprit. In my case it was the image retrieval which was slowing down my osg webcam example program. So moving the image retrieval function to an own thread made my example go from 4 fps to ~3000 fps. Cheers, Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61456#61456 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Thans Robert, since I haven't used this before, is the assignment enough for this or I should make some setups etc. What I did I just ser _image-setPixelBufferObject( new osg::PixelBufferObject ) and seeing the same performance . poor . Thanks again Nick On Wed, Oct 29, 2014 at 1:02 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi Nick, On 29 October 2014 11:14, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: it is TextureRectangle so NPOT is not an issue. Also, I am using the osg::Image for transfer of data from the CPU to the GPU, so it is not possible to have it all in the GPU. Thanks anyway though! Assign an osg::PixelBufferObject to the osg::Image to assist with the data transfer. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Hi Bjorn, I am using the osg::Image just for storing some vector data in it and passing it to the shaders, so not retrieving from anywhere. Thanks anyway Nick On Wed, Oct 29, 2014 at 1:18 PM, Björn Blissing bjorn.bliss...@vti.se wrote: Hi Nick, Make sure that it actually is the image transfer which is the culprit. In my case it was the image retrieval which was slowing down my osg webcam example program. So moving the image retrieval function to an own thread made my example go from 4 fps to ~3000 fps. Cheers, Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61456#61456 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frequently modified osg::Image uploads
Hi Nick, On 29 October 2014 12:35, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Thans Robert, since I haven't used this before, is the assignment enough for this or I should make some setups etc. What I did I just ser _image-setPixelBufferObject( new osg::PixelBufferObject ) and seeing the same performance . poor . Assigning the PixelBufferObject is all that is required. Have a look at the src/osg/ImageStream.cpp implementation for an example of how the PBO is assigned. If you are still seeing performance issues then look at the pixel formats and data type you are using, it could be that they aren't directly supported on the GPU so the GL driver has to convert the data into the internal texture format that is supported every time you update the data. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org