[SOLVED] Difference between DynamicVertexBuffer and VertexBuffer ?

I need to know what is the difference between DynamicVertexBuffer and VertexBuffer because in the two cases we can setData all times.

API-wise they are basically the same. DynamicVertexBuffer inherits from VertexBuffer and just adds two additional SetData functions:


It’s about optimization. By creating a DynamicVertexBuffer you are telling OpenGL/DirectX/MonoGame that you intend to change the contents frequently, so they can optimize for that use case, which should lead to better performance.
2 Likes

Use DynamicVertexBuffer only when you need to recalculate your Vertex Buffer very often as the data of the Vertex Buffer is sent over the bus to the gpu every frame this way as far as I know.
Under normal circumstances the VertexBuffer is the right choice since the Vertex Buffer will be sent one time. Transformations are applied to the vertices using Matrices (world matrix).

1 Like