Hi,
>
> I tried to reproduce the problem within a smaller
> program. I modified the QtArOpenSG sample (removing the
> AR stuff). When you press "s" or click on the tool button,
> the context is recreated using qt's setFormat method.
>
> The example just visualizes a torus:
>
> http://www.seac02.it/contextswitch/beforestereoswitch.jpg
>
> that's what I see when I switch to a stereo context:
>
> http://www.seac02.it/contextswitch/aftersteeoswitch.jpg
>
> I used the reinitializeAllGLObjects() method as you suggested.
>
> Looks like a messed up depth.... But the effects seem to
> be quite random. In this sample, the light colors seem
> to be ok, but in our production software we experience
> quite different problems as I described in my previous
> mail.
>
> Here's the code (windows only, sorry):
>
> http://www.seac02.it/contextswitch/QtArOpenSG.zip
I extended the sample above and tried to reproduce
the problem I actually see. I now use StereoDecorators
and ShadowMapViewports. I removed the reinitializeAllGLObjects
method and replaced it with something like this:
PassiveWindowPtr mPwinNew = PassiveWindow::create();
PassiveWindowPtr oldWin = mPwin;
// copy all viewports
for( unsigned int i = 0; i < mPwin->getPort().size(); ++i )
mPwinNew->addPort( mPwin->getPort()[i] );
mPwin = mPwinNew;
mMgr->setWindow(mPwin);
mPwin->init();
mPwin->activate();
mPwin->frameInit();
subRefCP(oldWin);
Essentially, I replace the PassiveWindow with a new one.
That fixes the bug you could see in the example I posted
in reply to this mail.
Now I added StereoViewports with shadows. When I switch
into stereo mode I create the viewports and add them
to the window. Here's the (correct) result:
http://www.seac02.it/contextswitch/firstSwitch.jpg
Here's what happens if I switch back to mono and
again to stereo:
http://www.seac02.it/contextswitch/secondSwitch.jpg
Somehow the diffuse light got screwed.
This does not happen if I _recreate_ the stereoviewports
everytime I switch into stereo mode.
I just have no idea what is happening...
here's the new sample code:
http://www.seac02.it/contextswitch/QtArOpenSG_stereo.zip
Regards,
Toni
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users