I'm updating our 1.0 parser to the new 1.2.0 spec and I have run across the <vertices> tag in a <mesh>. ( I'm not yet up to adding support for animations, so I'm restricting my questions to the usage within <mesh> )Can someone please give me a little bit more background on how and why this tag is used in preference of the "old" style that was like:
The spec mentiones that <vertices> should contain "...vertex attributes that are invariant to tesselation". And the <mesh> spec states that it "...describes the mesh-vertex attributes and establishes their topological identity".Code :<input semantic="POSITION" source="#box-Position"/> <input semantic="COLOR" source="#box-Color"/> <input semantic="NORMAL" source="#box-Normal"/> ..more per vert attribs...
My first question is - what elements are not invariant to tesselation? I can think of maybe tangent space vectors? But most other common profile things I can think of (normals, colors, UV) seem to me to be invariant to tesselation. But some are not really topological information? Can someone help me understand the options there?
My second question is about indexing. If you have something like the multimtl.xml sample that has:
if the <vertices> info has more than one child (maybe pos and color) then it seems the index of NORMAL as shown above kind of should be '2' ? This appears to make "VERTEX" semantic unlike all the others in that the idx can point to a tuple in the index array . I also can't look back at my parsed data in memory and find the NORMAL index with the input idx. The index offset '1' in the polygon needs to be re-indexed? This seems awkward to me - or am I missing something here?Code :<polygons count="5" material="#Blue"> <input semantic="VERTEX" source="#box-Vtx" idx="0" /> <input semantic="NORMAL" source="#box-0-Normal" idx="1" />
Thanks for reading this far :)