Archived

This topic is now archived and is closed to further replies.

GekkoCube

vertex buffers need be static length?

Recommended Posts

GekkoCube    116
i noticed that vertex buffers need to be static in length, meaning you cannot create the vertex buffer dynamically. is it necessary to create a vertex buffer that is EXACTLY the size i need it to be? Or can i have a vertex buffer that is, say, a few dozen vertices longer than what I need? what if the buffer is twice and long?

Share this post


Link to post
Share on other sites
Raloth    379
It''s ok if the vertex buffer is larger than how much you fill it with, just be sure to only render what you do fill. If it''s twice as large then something is very wrong and you are wasting a lot of memory (unless this is like a particle engine where the number you use changes very frequently).

Share this post


Link to post
Share on other sites
Raloth    379
You can create a dynamic vertex buffer. This signals the driver that data will be changed frequently so it can put it in the most optimal place in memory. Once a vertex buffer is made however, there is no way to change the size of it.

Share this post


Link to post
Share on other sites