Sunday, December 18, 2016

directx11 - Proper vertex buffer use


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.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...