Hi Tugkan, I'm just reviewing your changes and believe I understand the problem you are seeing, but the fix looks like it will break the OSG state manage as well as it changes OpenGL state that is covered by the osg::Stencil and osg::Depth StateAttributes, so we could easily end up with depth not being disabled/stencil when it should be as the lazy state updating won't know of the change.
I think two possible solutions would be to add an state.haveAppliedAttribute(...) to RenderStage after the setting the glDepthMask etc, or to have a Depth and a Stencil object within RenderStage that gets applied. The later solution is more coding so I've gone for the haveAppliedAttribute solution. I've tested the standard OSG examples and they all seems to be working fine. Could you try the attached changes to RenderStage.cpp to see if they work for you app as well, if things work fine I'll apply this fix to svn/trunk and the OSG-2.8 branch. Robert. On Fri, May 15, 2009 at 12:23 PM, Tugkan Calapoglu <[email protected]> wrote: > Hi Robert, > > I had some problems with render-to-texture in our graphics engine. After a > long debug session I found in RenderState.cpp that there is no glDepthMask( > GL_TRUE ) before glClear. There is however, a glColorMask(...) call to > ensure glClear will clear the color buffer. > > This is usually not a problem; however, in my case execution indeed came to > glClear with a disabled depth write state. If this happens depth buffer is > not cleared. > > I attached a fixed version to the email. > > Tugkan > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
