Hi Robert,
> So I you suggestion that osg::Geometry checks and then
> applies the state prior to dispatching the GL_PATCH_SIZE? Geometry
> gets sent to OpenGL after the osg::Program/glProgram has been applied
> so I'm guessing that this can't be done
> osg::Geometry::drawImplementation().
GL_PATCH_SIZE must be end before glDraw*, not necessary before useShader, so I
think osg::Geometry can do this.
(or maybe even the osg::PrimitiveSet::draw method).
Using an enum like this for osg::PrimitiveSet::Mode :
{
POINTS
LINES
LINE_STRIP
LINE_LOOP
TRIANGLES
TRIANGLE_STRIP
TRIANGLE_FAN
QUADS
QUAD_STRIP
POLYGON
LINES_ADJACENCY
LINE_STRIP_ADJACENCY
TRIANGLES_ADJACENCY
TRIANGLE_STRIP_ADJACENCY
PATCHES_0 // GL_PATCH - Patch size = 0
PATCHES_1 // GL_PATCH - Patch size = 1
PATCHES_2 // GL_PATCH - Patch size = 2
PATCHES_3 // GL_PATCH - Patch size = 3
...
PATCHES_N // GL_PATCH - Patch size = N
};
Could lead to following rules :
if (mode == POINTS) => use GL_POINTS
if (mode == LINES ) => use GL_LINES
....
if (mode >= PATCHES_0) => use GL_PATCH + set GL_PATCH_SIZE to (mode-PATCHES_0)
Thank you!
Cheers,
Aurelien
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54520#54520
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org