I have a UV-mapped model that I am about to animate and load into my game. Like most unwrapped models, I have several UV seams. In order to render the model correctly, I split each vertex along the seam into two vertices whose positions and normals are the same but whose UV coordinates differ. I do the same thing when I have more than one normal associated with a vertex.

This works fine for static models, but now I'm getting into the realm of animation. Technically since the two seam vertices occupy the same position in space they should use the same joint weights and joint IDs. Right now the simple way to do this is to just give them the same joint weights and joint IDs and then skin them separately. But to me this seems very wasteful because there are so many vertices along seams and so there will be many duplicate computations. It gets even worse since I need to render the animated model into the shadow map too.

Does anyone have any thoughts about improving this process? I've considered using something involving OpenGL transform feedback to save the results of the transformed vertices. This would at least help with computing transformed positions once and using the same results in the main render pass and shadow pass, but I still can't think of an elegant way to handle the duplicate computation along UV seams.

  • \$\begingroup\$ Which modelling tool are you using for this? Most tools I'm aware of don't require the creation of duplicate vertices for UV seams. \$\endgroup\$ – bummzack Jan 23 '13 at 7:47

That is the general way to do it. Since OpenGL only supports one index per vertex you have to split the vertices if their attributes differ in any way. The modeling tool or exporter you use should take care of this for you (like the edge split modifier in Blender). I would say not to worry about the amount of duplicated vertices, since they're unavoidable. The only thing you can really do is to use fewer UV seams.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.