Original Post
🔒 Locked
Multiple Models
Advertisement
When you start to optimize your code, you may create a vertex buffer and/or index buffer that holds multiple objects. You would update the vertex buffer to hold all 5 meshes with the world matrices already applied to each vertex. Then you only have to call DrawPrimitive one time. This will most likely be faster than calling DrawPrimitive 5 times and using the world transform to move it. You would want to have the vertices translated only once if they are going to always persist at the same location in the world.
Quote:
Original post by Supernat02
When you start to optimize your code, you may create a vertex buffer and/or index buffer that holds multiple objects. You would update the vertex buffer to hold all 5 meshes with the world matrices already applied to each vertex. Then you only have to call DrawPrimitive one time. This will most likely be faster than calling DrawPrimitive 5 times and using the world transform to move it. You would want to have the vertices translated only once if they are going to always persist at the same location in the world.
If you aren't already familiar with it, this technique is referred to as batching. It's probably the most effective technique for combating the biggest performance-related drawback of graphics today: CPU-boundness because of Draw calls. Here is an awesome slidedeck on the issue.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement