Hi,
I'm having problems with rendering multiple views of a scene, consisting of a 
terrain with PagedLODs (generated using VPB), and various other models.

The problems that arise are missing textures in one or several viewports and 
sometimes corrupted vertex data as well.

I have tested the following configurations:
One CompositeViewer with multiple osgViewer::View objects. This renders fine 
when only a single View is attached to the CompositeViewer. When a second View 
is added, it will render the terrain without textures at particular parts of 
the terrain surface. On occasion the polygons are distorted as well. The order 
in which the View-objects are added to the CompositeViewer affects the result: 
The View that is added first to the CompositeViewer will work fine. The scene 
data is the same for all views.

The same problems occur when using multiple osgViewer::Viewer objects instead 
of a CompositeViewer. I have tried to use 
"getCamera()->getGraphicsContext()->makeCurrent();" before frame() is called 
for each Viewer. I have checked that the context ID's varies among the Views.

Initially the windows were based on wxWidgets, using a canvas class (inheriting 
from wxGLCanvas and GraphicsWindow) as graphics contexts. But the problems are 
the same when I simply use the Viewer's "setUpViewInWindow(.)".

However, what does work is setting/creating the graphics contexts like:
unsigned int contextID = osg::GraphicsContext::createNewContextID();
osg::GraphicsContext* gc = 
osg::GraphicsContext::getOrCreateCompileContext(contextID);
m_pView->getCamera()->setGraphicsContext(gc);

Does this make any sense? Since we would like to render the views inside of 
wxFrame-derived windows, could a canvas class (inheriting from wxGLCanvas and 
GraphicsWindow) be created that does the same as "getOrCreateCompileContext"? 
Or is there something I might be missing? Helpful for any input.

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

Reply via email to