Hi Kim, The only problem I would see with this re-ordering is that if users are relying upon stereo and frame buffer based render to texture then their second render to texture pass would render over the top of the left image.
Given this one would certainly have to make your suggested re-ordering optional, even if it became the default. As a general comment, I'm wanting to replace the SceneView based stereo with osgViewer based stereo using slave Camera. One of the consequences of this would be the pre render stages for each slave camera would be done right before that camera's main render stage so you'd end up the behavior you are currently looking for. For this slave Camera based approach I'd need to think about what would happen with the frame buffer based rendering to texture. Robert. On 11 November 2011 11:43, Kim Bale <[email protected]> wrote: > Hi Farshid, > I just did a quick test and you appear to be right. > SceneView.cpp ~line 1099 > Changing the following: > _renderStageLeft->drawPreRenderStages(_renderInfo,previous); > _renderStageRight->drawPreRenderStages(_renderInfo,previous); > _renderStageLeft->draw(_renderInfo,previous); > _renderStageRight->draw(_renderInfo,previous); > To: > _renderStageLeft->drawPreRenderStages(_renderInfo,previous); > _renderStageLeft->draw(_renderInfo,previous); > _ > _renderStageRight->drawPreRenderStages(_renderInfo,previous); > _renderStageRight->draw(_renderInfo,previous); > Resolves the issue, allowing me to use the same FBO for both eyes. > Robert, if you're reading this, shouldn't this be the correct behaviour for > quad buffered stereo or is it designed this way to be consistent with the > other stereo modes? > I haven't yet looked at the implications for other stereo modes. > Cheers, > Kim. > On 10 November 2011 16:43, Kim Bale <[email protected]> wrote: >> >> Hi Farshid, >> Thanks for your reply. Fortunately I'm working with quad buffered stereo >> so I'll have a dig around in the SceneView code and see if your idea works. >> Cheers, >> K. >> On 10 November 2011 16:14, Farshid Lashkari <[email protected]> wrote: >>> >>> Hi Kim, >>> >>> On Thu, Nov 10, 2011 at 6:21 AM, Kim Bale <[email protected]> wrote: >>>> >>>> Is there a way of reusing the FBOs so that I don't need to duplicate >>>> them all for each eye? >>>> I couldn't seem to find a way of doing that without the previous data >>>> being overwritten. >>> >>> Which stereo mode are you using? >>> I run into this problem a lot as well. I believe the reason the previous >>> data gets overwritten is that osgUtil::SceneView explicitly calls >>> RenderStage::drawPreRenderStages() on both eyes, before drawing the main >>> render stage. You might be able to fix this by commenting out these calls >>> and letting RenderStage::draw() take care of the prerender stages, depending >>> on which stereo mode you are using. >>> I believe these explicit calls are necessary for the anaglyphic and >>> interlace stereo modes, because you wouldn't want the color/stencil mask >>> affecting the prerender stages. However, for the split and quad buffer >>> stereo modes, I don't believe these calls are necessary and it should be >>> safe to comment those lines out. >>> With a slight modification to SceneView::draw() it should be possible to >>> get this working with anaglyphics/interlace modes as well. This is something >>> that's been on my todo list for a while. Now might be a good time to try and >>> tackle the issue :) >>> Cheers, >>> Farshid >>>> >>>> Regards, >>>> Kim. >>>> _______________________________________________ >>>> 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 >>> >> > > > _______________________________________________ > 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

