How're you supposed to use vertex buffers?

Say you have 500 distinct deformable shapes/models in the world (ie you want to be able to change/delete vertices from the models somewhat arbitraily as the game progresses). The requires you refresh the vertex buffers in the frames the model has become dirty, at least.

So how should you handle your vertex buffer, assuming D3D11 interfaces (so vertex buffers are your only option to draw anything):

  • Store model vertices in CPU RAM. Create one vertex buffer at program start. For each model, copy the vertices into the single vertex buffer, render
  • Create 500 vertex buffers, update each when necessary, render.
  • 1
    \$\begingroup\$ I'm going to guess a single buffer with one update call. You really should run a profiler on either case and see what the real world says, though. \$\endgroup\$ Commented Jul 29, 2011 at 20:31
  • \$\begingroup\$ Just to mention - vertex buffers aren't really designed for this situation. It's quite rare to have a huge number of deformable shapes/models. Most rendering occurs with a relatively small number of fixed models, which are then animated via vertex shaders. \$\endgroup\$
    – ZorbaTHut
    Commented Jul 29, 2011 at 21:44
  • 3
    \$\begingroup\$ Wow, the only answer you ever accepted is your own. That's weird! \$\endgroup\$ Commented Jul 29, 2011 at 22:07
  • \$\begingroup\$ Best laugh I've had all day, thanks @Maik Semder =) \$\endgroup\$ Commented Jul 29, 2011 at 22:13
  • \$\begingroup\$ This article talks about GL_STATIC_DRAW, GL_DYNAMIC_DRAW, GL_STREAM_DRAW buffer usage hints \$\endgroup\$
    – bobobobo
    Commented Jul 31, 2011 at 14:27

1 Answer 1


At the bottom of this article, there are references to how to make dynamic vertex buffers.


This particular solution is "supposed" to dynamically "optimize" itself based on how frequently you are updating the vertices, etc. In other words, just let the DirectX API manage it for you.

I have had a similar problem rendering chained deformations where one object's deformation affects another, and so on, until it becomes cyclical.

In this case, maintaining the original vertex points is completely useless.

However, if your deformable objects retain somewhat of their original shape, you may be able to rely completely on geometry shaders, or other types as you need, and not have to update the vertices.

Without knowing your particular scenario, and the extent of the deformations, relative interval of the deformations, a specific architecture is pretty much impossible to recommend.



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .