Archived

This topic is now archived and is closed to further replies.

GamerSg

Texturing with Vertex Arrays

Recommended Posts

GamerSg    378
I am using the 3ds Loader from gametutorials and modified some parts so that it will output all the vertices into a text file with the indices, texture coordinates. So i exported a simple model to .3ds and ran the program. Before applying texturing, there were like 12 vertices. The problem comes after applying textures. The vertices suddenly explode to 48! I understand the reason is because when using vertex arrays, there need to be the same number of vertexes as Texture coordinates. But this defeats the whole purpose of using vertex arrays because now i have about 4 duplicates of the same vertexes. If i take away the texturing, it goes back to the original number of 12 vertices. So i was wondering if there is anyway i can keep the vertices to 12 and maybe use another indices array specially for textures.

Share this post


Link to post
Share on other sites
GamerSg    378
Hmm maybe i was not clear enough.

In 3d studio, there are still 12 vertices no matter how i apply the textures, but due to the way most 3d software programs save their data, they save it in a format similar to vertex arrays, where all unique vertexes are stored with indices values.

Texture coords and normals also use the same indices. So if there are more unique texture coordinates then unique vertices, the vertices are repeated so that they match the number of texture coordinates.

Share this post


Link to post
Share on other sites