noNchaoTic

Is there anyway to specify creation parameters for vertex buffers that are created by ContentManager.Load<Model>, i.e.: I want to be able to read back from those buffers. I suspect (from 20 mins of googling and reading bits and bobs) that there is not. Just wanted to double check. If not, does anyone know if there is a good reason why not

Cheers, and thanks,
Ste


Re: XNA Game Studio Express Model class vb woes

Kyle_W

I don't know what you mean by "specify". If you load a Model, you can access its vertex declarations and vertex buffer like so:

VertexElement[] ve = myModel.Meshes[0].MeshParts[0].VertexDeclaration.GetVertexElements();

myModel.Meshes[0].VertexBuffer.GetData();

There are several overloads for GetData() and you have to select the type that you want the data cast as so I didn't fully populate that line. If this doesn't answer your question, please clarify.





Re: XNA Game Studio Express Model class vb woes

noNchaoTic

I meant have the Model class create its Vertex Buffers with flags other than WriteOnly. Just anyone interested, you can't do this, you have to write a content processor.




Re: XNA Game Studio Express Model class vb woes

Shawn Hargreaves - MSFT

Currently, the default Model class always uses readonly vertex and index buffers. The only way around that is to make your own model type, or store the vertex data somewhere else rather than trying to read it back from the D3D buffers.





Re: XNA Game Studio Express Model class vb woes

noNchaoTic

Is this likely to change in the future