Hi.

   I am having a problem with texture when I want to integrate two windows that shows two different point of view of the same scene.  My scene is composed of LOD terra page terrain and flt models.  I have an instance of the producer viewer with a render surface and a camera in each of the winodws.  I tried everything I could find but I still doesn't work.  I still have strange texture effect on my second window. 

This is what I tried:

    First I tried using the share display list for each of the render surface:
            mRenderSurface->shareAllGLContexts(true);

   but then I had no texture in second window (everything is white)

   So I implemented my onw way of sharing the texure with wglShareLists:

        HGLRC wThisGLContex = wglGetCurrentContext();
        HGLRC wAnotherGLContex = SCENE_MGR_PTR->getShareGLContext();
        if(wAnotherGLContex)
          wglShareLists(wAnotherGLContex,wThisGLContex);     
       SCENE_MGR_PTR->setShareGLContext(wThisGLContex);

   then I was able to see some texture on my second widow but the texure are not the good one and I have stange effect....
 
   Finaly I tried to force the context ID to 0 for the first window and 1 for the second window

    osgProducer::Viewer::SceneHandlerList shl = mOSGProducerViewer->getSceneHandlerList();
    osgProducer::Viewer::SceneHandlerList::iterator p;
    unsigned int n = 0;
    for( p = shl.begin(); p != shl.end(); p++ )
    {
      int inheritanceMask = (*p)->getSceneView()->getInheritanceMask();
      inheritanceMask &= ~(osg::CullSettings::CULL_MASK);
      (*p)->getSceneView()->setInheritanceMask( inheritanceMask );
      (*p)->getSceneView()->setCullMask(DISPLAYED_BY_2D);
      (*p)->setContextID(0);
      n++; 
    }

  but that didn't give me any improvement....

  I read somewhere the the database pager might not support two rendering surface:
  http://www.mail-archive.com/[email protected]/msg01449.html

  Is there a way to get it to work?  Does somebody have an Idea???

  Thank you all!

Mitch

 


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to