Archived

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

aker_jus

Terrain VertexBuffer switching.

Recommended Posts

aker_jus    122
Hello, after some weeks, I have my terrain renderer working. I have divided my terrain into chunks of 32x32, each with its own VB. The thing is, if I have a 2048x2048 terrain, that consists of 64 chunks, so 64 VBs. In the render function, I iterate through the chunks, set vbs, textures, materials, and render. Is there any way I can reduce the VB switching? How do you manage your terrain vertexbuffer(s)? Thanks

Share this post


Link to post
Share on other sites
NeonGE    140
I do exactly the same thing with my terrain renderer, what you can do is use frustrum culling to determine wich chunks you are watching and just render those.

And just to settle this you have:
2048x2048 / 32x32 chunks = 4096 pieces.

If God with me, Who against me?

[edited by - NeonGE on April 29, 2003 10:34:31 AM]

Share this post


Link to post
Share on other sites
reaptide    226
Rather than switching vertex buffers so often (Which can be a rather expensive operation sometimes) why not determine which chuncks are visible and then copy their vertices into a large dynamic vertex buffer?

This way you only end up with one vertex buffer and copying into one is mighty quick.

Share this post


Link to post
Share on other sites