Hi Robert,

When writing a tesselation shader, you have to decide the patch size you want 
to be used as input by this shader.

I mean that your code for 3-vertices patch will be really different from a code 
for doing the same thing with 4-vertices patch.

So, I think the idea "GL_PATCH_SIZE is associated with the program" is not a 
bad idea, since they are really correlated.

The idea of a StateAttribute could lead to better optimization (less openGL 
call to set alwas the same GL_PATCH_SIZE value) but I don't think that's a good 
idea because it can be hard to always know which GL_PATCH_SIZE value will be 
used for a particular shader.

Maybe another idea should be to exend the osg::PrimitiveSet::Mode enum like 
that : (so all CPU code, like visitors know how to iterate over the data)


Code:
{
        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_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
};





Thank you!

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54490#54490





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to