Dynamic Vertex Buffer / Index Buffer in XNA

 

Vertex Buffer and Index Buffer are two vital “components” in XNA rendering. In another word, if you managed to figure out how it works and how it works faster, you will get a faster rendering engine in XNA.

As you may notice, there is no Draw Box, sphere, etc functions in XNA framework and it is very inconvenient for rendering and collision detection. So I decide to program my own game component to render the bounding box, bounding sphere and bounding volume(still developing).

Here are the sample and the source code

P.S.

 For the vertex buffer updating, I strongly suggest you check Shawn Hargreaves’ Blog, which describe the stalling between CPU and GPU when rendering. And it is a very good blog for XNA developing. Updating the VBO in my source code is taking the advice of using a double buffers from Stalls part two: beware of SetData

Here is the screen shoot:

posted on 2008-04-30 17:40  SigEric  阅读(1079)  评论(0编辑  收藏  举报

导航