H Jan, I've merged your changes as-is, save for a few minor tweaks to formating and case of header include. The change to GL_STENCIL_TEST_TWO_SIDE is problematic though. I'm not familiar with the specifics of the various extensions so perhaps you can point me in the right direction. i.e what mode is used to toggle two sided stencil under ATI, Nvidia and GL2 respectively?
Robert. On Fri, Aug 20, 2010 at 8:30 AM, PCJohn <[email protected]> wrote: > Hi Robert, > > please, find attached improved Stencil and StencilTwoSided classes. > > Goals: > - to handle INCR_WRAP values nicely if not supported by OpenGL (old > hardware) > - to support two side stenciling of OpenGL 2.0. Current implementation does > not work on ATI as it uses Nvidia extension. > > Ready for commit: > - Stencil and Stencil.cpp - please, review them > > Ready with "hack": > - StencilTwoSided.cpp: please, see the line 113 in apply(): > > glEnable(GL_STENCIL_TEST_TWO_SIDE); > > This line used to be in getModeUsage() as > > usage.usesMode(GL_STENCIL_TEST_TWO_SIDE); > > but it produces OpenGL errors on ATI as it is unknown value there (it is > Nvidia extension). > Problems with my "glEnable" solution: > - it enables two side stenciling forever, and it will disturb any other > single-side stenciling in the scene graph. > How to enable GL_STENCIL_TEST_TWO_SIDE properly only when Nvidia extension > is going to be used? I am puzzled with the solution. Please, advice. > The only solution I considered is to split implementation to two classes. > But at the end, we may finish with four classes: one for one-side stencil, > second for Nvidia extension, third for ATI extension and fourth for OpenGL > 2.0. Maybe, just three classes, but only two would be nice... Please, > advice. > > Looking forward for good OSG stenciling... > John > > > _______________________________________________ > 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
