On 01/07/2011 10:52 AM, Jean-Sébastien Guay wrote:
I don't have reliable info to add, but I wonder 2 things:
First, does OpenGL interpret one primitive as one draw call (= one
*PrimitiveSet*) ? If so, then that's your answer, BIND_PER_PRIMITIVE
would mean one normal for the whole triangle strip.
BIND_PER_PRIMITIVE is a scene graph thing, it has nothing to do with
pure OpenGL. All BIND_PER_PRIMITIVE means is this:
glBegin(GL_TRIANGLE_STRIP);
glNormal3f(...);
glVertex3f(...);
glVertex3f(...);
...
glVertex3f(...);
glEnd();
BIND_PER_PRIMITIVE will always revert to the slow glBegin/glEnd path.
This is because OpenGL has no way to do per-primitive normals or colors
using glDrawArrays() or glDrawElements(). So yes, BIND_PER_PRIMITIVE
means one normal for the whole primitive. In this case the primitive is
the triangle strip (the argument to glBegin() ). I suppose you could
change the normal in the middle of the strip with pure OpenGL, but I
have no idea what it would end up looking like (might have to check an
older spec for that). My guess is that it wouldn't be what you're
looking for, though.
I believe the primitive length question is similar. It refers to how
many vertices per primitive. In this case, the primitive is the
triangle strip, and the length is the number of vertices in the strip.
I'm pretty sure that setting that to 3 in the switch statement you
referred to is wrong.
--"J"
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org