Hi Christian,

my geometry has 9 vertices - i thought if i use a drawElement index with index 
swaps to revist a vertex, this would give me the opportunity to use more than 
one normal per vertex (there are reasons why i need this ;-). i now think the 
truth is, only real vertices in the vertexlist let me allow to do this.

Yes, if you need hard edges, then you need different normals for the same vertex when it's part of a different face. But the way to express that with vertex arrays is to duplicate the vertex in the array and use a different normal.

Your analysis seems correct. From what you say above, what you actually did was have a larger number of normals than vertices, thinking that then the extra normals would be used when the same vertex was used in a different primitive set. That doesn't work. When normals are used in BIND_PER_VERTEX mode, it's assumed that you have the same number of vertices as normals, and so the result was just that the extra normals were never used. (same with colors in the color array BTW)

So to recap, if normals are used in BIND_PER_VERTEX mode, then vertex i is used with normal i. But vertex i and vertex j can be equal, with a different normal j. And then vertex i and vertex j can be part of different triangles (well, should, otherwise you have a degenerate triangle).

At first this seems like a waste of memory, but the hardware is really optimized to work this way.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to