Hi Shahar,

I would say that this is expected behaviour. This is due to the case, that the 
texture has to be copied from the GPU memory to the CPU memory. With PBOs this 
should be done through DMA or somehow directly without involving CPU for this, 
however the PCIe bus is the bottleneck here. I

In general, consider if you need to have the resulting texture on the CPU at 
all ;) Maybe you can comeup with shaders which do exactly this, what you would 
do on the CPU. 


Actually with PBOs you can have asynchronous texture transfer. Not sure about 
download from GPU, but surely for uploading to the GPU. However, I can imagine 
that whenever you download the texture in every frame, which is automatically 
doen by osgPPU, the execution might stall, while the download isn't complete 
yet. Hence, what you might try is to write a callback which will just switch on 
the PBO use every nth frame, if you don't need the output of osgPPU in every 
frame. It might be that this could solve the problem, since the texture can be 
downloaded asynchronously during the rendering of the n frames.

I am not sure if this will work out, but you might try this.

Cheers,
art



kshahar wrote:
> Hi,
> I'm new to osgPPU and OSG in general, so please bear with me :)
> 
> I'm trying to use the built-in mechanism in osgPPU::Unit for copying the 
> rendered textures to the CPU. 
> I'm using a simple tester based on one of the osgPPU examples, and my 
> initialization code is structured like this:
> 
> Code:
> 
> // Somewhere in the middle of the Processor graph:
> osgPPU::Unit* pUnit = new osgPPU::UnitInOut();
> pUnit->setUsePBOForInputTexture(0, true);
> parentUnit->addChild(pUnit);
> 
> 
> 
> 
> With this code the frame rate drops significantlly, from 60 to 10-30 
> (dependning on the viewport size). If I comment out the glGetTexImage call 
> inside Unit.cpp, everything works as before (but nothing gets copied, of 
> course).
> 
> Considering I don't mind getting the texture with a delay of a few frames, is 
> there any way to improve the performance of the current implementation?
> I must say I've read about PBO (http://www.songho.ca/opengl/gl_pbo.html), but 
> I'm not sure whether this is the correct approach here, or how to integrate 
> it with the existing code base.
> 
> Thanks,
> Shahar


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45854#45854





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

Reply via email to