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 

multiple processors


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


Joined: 16 Dec 2011
Posts: 146

PostPosted: Tue Nov 20, 2012 3:03 pm    Post subject:
multiple processors
Reply with quote

Hi art and all

This is not my first post about osgPPU and composite viewer, but I get no read feedback so I try it once more.

I have a composite viewer, and I can add views at runtime. I use osgPPU and it works with one viewer (the first created). For every additional viewer I also create a separate unit pipeline and separate processor, and I add the latter to the scene graph root node.

Everything seems to work, except that osgPPU runs only on the first view, every additional viewer is black.

Art, can you provide some feedback where the drawbacks are that hinder my second view of having his own postprocessing? I have a separate processor, separate units and the processor attached to the correct camera. What else do I have to check?


Thank you!

Cheers,
Daniel
Back to top
View user's profile Send private message
danoo
Appreciator


Joined: 16 Dec 2011
Posts: 146

PostPosted: Wed Dec 05, 2012 2:59 pm    Post subject:
Reply with quote

I'm kind of talking to myself here... and since 2010 there is no sign of Art Tevs... anybody saw him lately?

Well, if anybody cares, I found out a solution to have multiple processors with compositeviewer, each view can have its different osgPPU pipeline, etc.

1. All you need to add is a group node to your scene, that holds all the processors.
2. then you need to add this little snippet of code to Processor.cpp in the traverse method:

Code:

    // make sure we render only our own camera
    if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
    {
      osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor *>(&nv);
      if (cv)
      {
        if (cv->getCurrentCamera() != getCamera())
        {
          return;
        }
      }
    }

    // first we need to clear traversion bit of every unit
    if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
    {
        CleanUpdateTraversedVisitor::sVisitor->run(this);
    }



3. You need to make sure your camera viewport of each view is set to an origin of 0/0. Control the position of the rendering viewport by setting the UnitOut viewport to the desired origin.

This is due to a limitation of osgPPU, which copies to and from the render target always relative to a 0/0 origin.


Now Enjoy osgPPU and compositeViewer!
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: Wed Dec 05, 2012 6:52 pm    Post subject:
Reply with quote

Hi,

Art is here, he was always here Smile

My current research and work is non-osg related, hence I unfortunately somehow stalled in producing updated.

Daniel, could you post the code as a patch to the osgPPU version you use? I would then implement this into the code.


Cheers,
Art
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 Multiple render passes and multithrea... SMesserschmidt General 2 Wed May 03, 2017 3:53 pm View latest post
No new posts Recommended way to render a scene fro... Hannes Naude General 6 Tue Apr 11, 2017 11:12 am View latest post
No new posts Multiple cameras sharing multisample fbo ravidavi General 1 Sat Mar 11, 2017 8:17 am View latest post
No new posts How to improve frame rate when loadin... vinothrajendran4 General 9 Wed Feb 22, 2017 2:01 pm View latest post
No new posts multiple input with osgwidgets Meldryt General 6 Fri Aug 12, 2016 6:49 am 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