Hi,

 

I've implemented two FBOs in my stereo application (MultiDisplayWindow), one
for the left eye and one for the right eye. If I'm running local all works
fine. But if I'm using the FBOs over the network they simply capture a black
screen to the FBO textures. I think it has something to do with the missing
RenderAction on the server side. Does anyone know how to implement a FBO
using render servers?

 

I've already looked at the FlexiviewWindow, but it doesn't work for me,
because I do not use the SimpleSceneManager. I've appended the relevant
code, I think. ;)

 

Thanks in advance.

Marcus

 

void OSGSceneGraph::renderServers()

{

  update();

 

  if(m_multiWindow != NullFC)

  {   

    //renderaction is initialized on serverside

    m_multiWindow->render(); //<- how to get the renderaction?

    OSG::Thread::getCurrentChangeList()->clearAll();

  }

  else if (m_singleWindow != NullFC)

  {

    // use renderaction just like on serverside

    m_singleWindow->render(m_renderAction);

    OSG::Thread::getCurrentChangeList()->clearAll();

  }

}

 

void FBOWidget::update()

{

  m_window->activate();

  m_window->frameInit();

 

  //render scene from left eye

  m_fboLeft->render(m_renderAction);

 

  //render scene from right eye

  m_fboRight->render(m_renderAction);

  OSG::Thread::getCurrentChangeList()->clearAll();

 

  m_window->frameExit();

  m_window->deactivate();

}

 

//---------- initstuff ------------

// renderaction required local only - same like on serverside

m_renderAction = RenderAction::create();

 

if (_connectionType != LOCAL)

{

  // the connection between this client and the servers

  m_multiWindow = MultiDisplayWindow::create();

  setName(m_multiWindow, "MultiDisplayWindow");

 

  beginEditCP(m_multiWindow);

  {

    if(_connectionType == MULTICAST)

      m_multiWindow->setConnectionType("Multicast");

 

    for (int i=0; i < _serverAdress.size(); i++)

    {      

      Tracer::info("OSGSceneGraph", "OSGSceneGraph", "Server %i: %s", i,
_serverAdress[i]);      

      m_multiWindow->editMFServers()->push_back(_serverAdress[i]);

    }

  

    // initial size has to be an aspect of 4:3 !!!

    m_multiWindow->setSize(m_screenSize.x() / m_screenDivisor,
m_screenSize.y() / m_screenDivisor);

    

    m_multiWindow->addPort(m_leftViewport);

    m_multiWindow->addPort(m_rightViewport);

   

    m_multiWindow->init();

  }

  endEditCP(m_multiWindow);

}

else

{

  if (_glutWindowId == -1)

  {

    Tracer::error("OSGSceneGraph", "ctor", "Local Glutwindow was not
inititalized.");

    return;

  }

  

  m_renderAction->setZWriteTrans(true);

  m_renderAction->setSortTrans(true);

  m_renderAction->setStateSorting(true);

  m_renderAction->setCorrectTwoSidedLighting(true);

  m_renderAction->setLocalLights(true);

  m_renderAction->setAutoFrustum(true);

  m_renderAction->setFrustumCulling(true);

  m_renderAction->setSmallFeatureCulling(true);

  m_renderAction->setSmallFeaturePixels(0);

  m_renderAction->setSmallFeatureThreshold(50);

 

  // the connection between GLUT and OpenSG

  GLUTWindowPtr gwin= GLUTWindow::create();

  gwin->setId(_glutWindowId);

  gwin->setSize(m_screenSize.x() *2,m_screenSize.y() );

 

  // the connection between this client and the servers

  m_singleWindow = gwin;

  beginEditCP(m_singleWindow);

  {

    setName(m_singleWindow, "SingleWindow");

 

    m_singleWindow->addPort(m_leftViewport);

    m_singleWindow->addPort(m_rightViewport);

    

    m_singleWindow->init();

  }

  endEditCP(m_singleWindow);

}

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to