Argentieri, John-P63223 wrote:
Gentlemen,
Is there a way to force vertex B to have a different texture coordinate in each of triangle ABC and triangle BCD? Texture coordinate indices? I don't understand how those are applied. If the binding is per_primitive, will each of my triangles be textured by a single pixel?

PER_PRIMITIVE texture coordinates aren't allowed (only PER_VERTEX, or none at all). Also, you don't want to use texture coordinate indices because they'll knock you into immediate mode (slow) rendering.

The easy way to get what you're looking for is to have arrays like this:

vertex array:  vA, vB, vC, vB, vC, vD
texcoord array:  tA, tB1, tC, tB2, tC, tD

where tB1 != tB2

and use a DrawArrays primitive set (ie: don't use DrawElements). In other words, just duplicate the vertex positions explicitly in your vertex array, and make the corresponding texture coordinates whatever you need them to be.

--"J"

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to