Model formats and vertex attributes

Started by
2 comments, last by JohnBolton 19 years, 4 months ago
I've finally started to seriously work on implementing textured meshes into my engine, but am rather confused by certain model formats. I've downloaded Wings 3D (http://www.wings3d.com/) and have created and skinned a model. I'm not using the internal model format and am taking advantage of the program's ability to export other formats. For now, I'm looking at the plain text formats. The problem is that all of them separate vertex attributes into coordinates, normals, and texture coordinates. This wouldn't be an issue except for the fact that there's more normals and texture coordinates than vertex coordinates, making it quite unfriendly to vertex arrays. I don't think there's any implementation that allows one to use a separate index array for each attribute, and I would prefer not to simply duplicate vertices. However, other than OpenGL display lists, is that the only solution?
-Ostsol
Advertisement
duplicating the vertex data as needed is the normal way of dealing with the situation, in reality this shouldnt present a huge increase in your data size anyways
Hmm. . . That's disappointing. Well, I guess I could parse through the result and eliminate any vertices that are total duplicates. There's bound to be alot when individual triangles are used. . .
-Ostsol
The reason is that a vertex consists of all of its attributes, not just its location. So if any attribute is different, then it must be a different vertex. There is no reasonable way to get around this.

However, I predict that graphics hardware will someday support separate indexes/buffers for each attribute.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement