Hi Robert,

actually, the only motivation is the support of older hardware which, for instance, include my old netbook with Intel 945GM graphics chip (in Core2 chipset). It supports NVIDIA's EXT_stencil_two_side extension only. Looking on internet, ... I became not sure how far OpenGL went on current netbooks and low-power Intel solutions. But maybe, it would be a real loss in the "small laptop" world.

Sure, we can drop it, but in my humble opinion, it would be better to leave it as it is, e.g. keeping glEnable(GL_STENCIL_TEST_TWO_SIDE) and no support for mixing one and two sided stenciling, than to remove the extension support completely. But others may have different opinion.

Do you think it will be too difficult to develop "proper" solution? I am able to put a little bit time to it, if you provide few hints about the proper solution.

Your opinion?
John


Robert Osfield wrote:
Hi John,

Thanks for the explanation.

Is it necessary to support the Nividia extension anymore?  If OpenGL
2.0 support is sufficient then the both the NVidia and ATI extensions
are effectively deprecated, or do they add something extra in terms of
functionality?

Robert.

On Wed, Sep 15, 2010 at 11:49 AM, PCJohn <[email protected]> wrote:
Hi Robert,

thanks for merging. The GL_STENCIL_TEST_TWO_SIDE issue:

OpenGL 2.0 has its own functions glStencil[Func|Op|Mask]Separate that
handles both sides of polygon.
-> GL_STENCIL_TEST_TWO_SIDE mode should not be set as OpenGL errors may
follow (GL_STENCIL_TEST_TWO_SIDE is not a part of OpenGL 2.0 specification)

When using GL_EXT_stencil_two_side, GL_STENCIL_TEST_TWO_SIDE should be set
to activate two sided stenciling.

When using GL_ATI_separate_stencil, GL_STENCIL_TEST_TWO_SIDE should not be
set as OpenGL errors will probably follow.
(This extension is not completed yet, but it will be trivial once
GL_STENCIL_TEST_TWO_SIDE issue is resolved.)


Now, the problem: Using StencilTwoSided::getModeUsage method for setting
GL_STENCIL_TEST_TWO_SIDE seems inappropriate as there is no context in cull
phase to choose which of the three options will be used
(ATI/NVIDIA/OpenGL20). Putting glEnable(GL_STENCIL_TEST_TWO_SIDE) in
StencilTwoSided::apply means that it will be activated for the rest of the
life of the application (e.g. there will be no glDisable  afterwards),
resulting in garbage for applications that mix standard stenciling and two
sided stenciling.

The issue is above my current OSG knowledge.

If needed, feel free to ask more details.
John


Robert Osfield wrote:

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


_______________________________________________
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
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to