   Vertex buffers / rendering process
  Sorry for the newb-type post, but I''m having some difficulty understanding vertex buffers.Assuming I''m trying to render a whole list of objects:Do I want one vertex buffer that I then fill with all the vertex data for a scene?  Or do I want one buffer that I fill with all the vertex data for an object, then call DrawPrimitive, then clear the buffer and repeat for the next object?Or do I want one VB for each object, and then switch between them (even though the reference material says this is bad)?Furthermore, is it a good idea to keep verts in the buffer between frames, or is the best approach just to copy them over every frame?Again, sorry for the newbie questions.  Thanks in advance...Matt  
  I guess, to an extent, it depends.If you would like to move your objects individually then you should have a vertex buffer for each object.  This means that you can move each object around world space without modifying the vertex buffer.  But you will need to lock and unlock buffers so that you can fill them with the data necessary to render different objects.Now I know that you hear how it takes time to lock/unlock VBs and it gets into your brain that this is a bad thing but understand that it''s not bad if used in an intelligent way.  I''m not sure as to what your reference material is but if you want to maintain some sense of Object Oriented code then it is necessary and can make your projects much easier to work with.;  Think about it in terms of the best way to have the data "live on the card". That should answer some of your questions.For instance, you wouldn''t want to clear and refill a buffer because then the data effectively lives on the system, not the card. Your idea of clearing the buffer and refilling essentially destroys the advantage of buffering. If you have a cube, store it in a vertex buffer and keep that buffer for the lifetime of the cube.If you have two cubes and they share FVFs, etc., store them both in the same buffer and render them with one call to DrawPrimitive or DrawIndexedPrimitive. If you only need to draw one of the cubes, render only a subset of the buffer. If you need to apply different transformations, do something like the following:Transform1DrawPrimitive(first half of buffer)Transform2DrawPrimitive(Second half of buffer)Remember, you don''t have to render the whole buffer.Notice that in all cases, the vertices for the two cubes are stored in a vertex buffer that (in the best case) lives on the card. Contrast this with the case of refilling the buffer for each cube and/or doing that every frame.The basic higher level rule of thumb is to batch things up whenever possible. If it makes sense to store multiple objects in the same buffer, do so, but don''t bend over backwards shoehorning every little thing into one buffer if it doesn''t make sense.Just to give you an idea about locking, etc. I almost never lock vertex buffers after they are initially filled. At least for my purposes, the only reason for ever locking the buffer is to fill it or to move screen coordinate vertices. All other manipulations are done with matrix operations. In some cases, I store many things in one buffer. In other cases, I have many buffers, either due to laziness or necessity (different vertex types, etc.)  