Hi Mathias, You don't really provide enough info about your overall viewer setup to give a direct answer. It sounds like you are using the OSG's low level stereo support in osgUtil and combining this with a 3rd party code that does distortion correction or similar. Doing low level stereo and distortion correction is really going to work visually even if you got it to work code wise, as the low level stereo support in osgUtil assumes a flat display.
Have a bash at explaining what your system is trying to do at a high level and then others will have a better chance of suggesting how to go about it. Robert. On Tue, Aug 4, 2009 at 4:10 PM, Mathias Buhr<[email protected]> wrote: > Hi, > > before going into the details of the problem, I'd like to explain what I'm > trying to do and what I have done until now. > I have a 3rd-party function/method which is out of my scope. It seems to > read and write the window-system provided framebuffer and > manipulates/distorts the image. The first implementation was through calling > this function in a postdraw-callback. Everything works fine this way. > Unfortunately this is not possible if the CHECKBOARD flag is set because the > postdraw-callback is called after the complete frame (including the > stenceling for the checkerboard) is rendered. The function would distort the > checkerboard. Hence, I have to apply this function for each "eye" > separately. > This seems possible with some changes to OSG itself but it also would break > the possibilty to upgrade later. So I decided to take another approach: > > I've tried rendering to an FBO (RTT, similar to osgprerender) but I can't > apply the function anymore in the postdraw-callback (gives GL errors). Since > there is no access to the OSG-managed FBO (for bliting from FBO to FB) I > have implemented my own and rendered to that instead. I'll give you a brief > overview for that: > > MainCamera > - addChild(QUAD_STRIP) //an osg:Geode with an > osg::Texture2D > - addChild(LeftCamera) > - PreDrawCallback: > - if (!fbo) glGenFramebufferEXT > - glBindFramebufferEXT > - glFramebufferTexture2DEXT //attach the osg::Texture2D > - PostDrawCallback: > - glBindFramebufferEXT(0) //bind window-system fb > > LeftCamera is set to PRE_RENDER > > This approach gives me the result which is shown in this picture: > http://www.apparatus.de/test1.png > > Does someone have an idea what is going wrong or what I've missed? I've > looked at the RenderStage code (and much more :-) ) but I haven't found > something that might be the problem. > > Or maybe there is another (better) approach to this problem. Any hints for > that? > I would appreciate any help! Thank you very much for reading :-) > > Greetings > Mathias > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

