OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Perfomance issues with PBO for input textures


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgPPU [osgPPU]
View previous topic :: View next topic  
Author Message
kshahar
Newbie


Joined: 28 Oct 2010
Posts: 10

PostPosted: Tue Feb 28, 2012 2:49 pm    Post subject:
Perfomance issues with PBO for input textures
Reply with quote

Hi,
I'm new to osgPPU and OSG in general, so please bear with me Smile

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, but I'm not sure whether this is the correct approach here, or how to integrate it with the existing code base.

Thanks,
Shahar
Back to top
View user's profile Send private message
art (Art Tevs)
Site Admin


Joined: 20 Dec 2008
Posts: 414
Location: Saarbr├╝cken, Germany

PostPosted: Tue Feb 28, 2012 6:54 pm    Post subject:
Re: Perfomance issues with PBO for input textures
Reply with quote

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 Wink 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 Smile

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, but I'm not sure whether this is the correct approach here, or how to integrate it with the existing code base.

Thanks,
Shahar
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgPPU [osgPPU] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts design issues Trajce Nikolov NICK General 4 Wed Nov 02, 2016 10:25 pm View latest post
No new posts camera far plane culling issues Trajce Nikolov NICK General 2 Sun Oct 16, 2016 10:33 pm View latest post
No new posts porting old code to the latest osg is... Trajce Nikolov NICK General 4 Fri Sep 02, 2016 12:11 am View latest post
No new posts multiple input with osgwidgets Meldryt General 6 Fri Aug 12, 2016 6:49 am View latest post
No new posts Simulating Light Lobes with Projected... Trajce Nikolov NICK General 3 Thu Aug 11, 2016 9:57 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP