Archived

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

GekkoCube

quadtrees and index buffers

Recommended Posts

GekkoCube    116
My quadtree is a pretty big one with approximately 10 vertices per node. I need to utilize vertex and index buffers to improve things since i am currently using DrawPrimitiveUP() to draw per node. Terrible, I know! I understand that the optimal size for a buffer is about 1000 vertices/indices. So, im guessing i need several buffers of size 1000. and i just fill them as i update the tree.... this sounds like a heck of alot of maintenance. one slight miscalculation could cause my computer to go spiraling down and probably give me to blue screen due to some buffer over-run on this XP machine (which i have gotten way too many times as a result of improper use of vertex buffers).

Share this post


Link to post
Share on other sites
Raloth    379
1000 is the recommended number of vertices per DrawIndexedPrimitive call, not the size of the vertex buffer. The actual size your vertex buffer should be depends, but around 2 megabytes is good for the driver to play around with it. 2 megabytes is 65536 vertices, assuming each vertex is 32 bytes.

Share this post


Link to post
Share on other sites