Hi Aurelien, On 10 June 2013 12:23, Aurelien Albert <[email protected]> wrote: > As far as I know, tesselation shaders can be used only with GL_PATCH > primitive type. So maybe this flag can be "DrawMode==GL_PATCH" ?
There is already the PrimitiveSet::Mode::PATCHES that maps to GL_PATCHES. 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(). osg::Program doesn't know about the osg::Geometry so can't decided whether to set the GL_PATCH_SIZE based on the PrimitiveSet::Mode. I think we are stuck moving where the GL_PATCH_SIZE is set so it's before the useProgram() and doing it all the time, or based on whether the osg::Program contains a tessellation shader. > This could also be used in traversal algorithms (such as intersectors) : > maybe an optional flag like "ignorePatchPrimitive" ? > > With this flag set on a Visitor, it should ignores all primitive set of type > "GL_PATCH" but still call user-defined callbacks : > - don't execute an algorithm that will be wrong (the generic algo cannot be > used here) > - still execute a user defined algorithm if provided This is another topic, but in general I agree with this general approach, ignore what can't be directly handled or has a fallback provided. Robert. _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
