Question: I am using DrawIndexedPrimitives() for drawing a loaded 3D model by drawing each [mesh part](http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.modelmeshpart.aspx), but this process makes my application very slow. This is perhaps because of a very large number of vertex/index buffer data created in video memory. 

That is why I am looking for a way to use the same method for each [model mesh](http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.modelmesh.aspx) instead. The problem is that I don't know how I will set the textures of that mesh. Can anyone offer me some guidance?

Answer: 
Make a single texture atlas by combining all your mesh's textures into one, in any image editing program. Then you'll have to go into your 3D modeling program to set the texture atlas to all the parts of your model, and UV re-map. The re-mapping is not as daunting as you might expect- it'll usually just be a matter of rotating, proportional scaling and moving the groups of vertices until they fit with the new texture. Export the mesh with the new texture coordinates.

Combine your mesh parts into a larger one in runtime. When the models are being loaded, read each vertex buffer and index buffer and join them together to create one large vertex buffer and index buffer. This is a non-destructive change, as you still get to keep the individual mesh parts if you want to go back and make any further tweaks in the modeling program. Now with these new buffers, you only need one draw call and one texture change to render each model.

Your program sounds like it's drawing a complex or busy scene, so it may take some time to build the new vertex buffers dynamically. However, you'll just do this once each time they load in the program.
If the entire model uses only one texture, theoretically you can set that texture and draw the model's vertex buffer and index buffer in one call, since the entire model is stored in a single vertex and index buffer.

Except, when you load the model the indexes for various mesh parts will not be relative the vertex buffer as a whole, but rather the mesh part's vertex offset, making that impossible for no good reason. So to draw the entire model in one draw call you will have to create a new index buffer with corrected indexes.