Jump to content
  • Advertisement
Sign in to follow this  
ultimastrike

Vertex/Index buffer optimization

This topic is 3968 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have been reading up on different ways that you can reduce the detail of terrain to optimize performance, but I was wondering if there is a good technique for culling all indices that are outside the camera's possible view. To be clear, I am hoping for a method to send all of the indices x units in each direction to be drawn, instead of sending the entire landscape to be drawn. I have discovered that trying to send a single index buffer for a heightmap larger than 128x128 gives me errors with my video card, so I'd like to use this method of culling far-away indices to correct it. Basically: Given the camera's x/y/z coordinates, find all indices x indices in each direction, send this subset of indices to be drawn. Is this possible?

Share this post


Link to post
Share on other sites
Advertisement
quadtree, geomipmapping(possibly), frustum culling. search gamedev or google for this stuff, i`m sure you`ll find everything you need.



uh i thought limit for meshes for indices is 65536, not 128x128. anyone?

Share this post


Link to post
Share on other sites
You can use the offset parameters to DrawIndexedPrimitive() to index more than 216 vertices in a 16bit index buffer [wink]

Clever tricks this way can allow you to re-use large index buffers for optimal quadtree terrain rendering - I found that more than 32x32 patches wasn't really necessary most of the time.

You can write out a generic IB with 5 (for example) levels of LOD for various resolutions of patch, almost like an array of mip-maps. Using a quadtree and clever index/vertex offsets you can write a very efficient terrain renderer.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by MassacrerAL
uh i thought limit for meshes for indices is 65536, not 128x128. anyone?
It depends on how you implement it, but yes you are correct about the 65k indices.

A pure 128x128 points giving you 127x127 'tiles' gives you 214 and 256x256 (for 255x255 tiles) is 216, but some people will want 128 tiles or 256 tiles, meaning its actually a grid of 129x129 or 257x257 - which can push you very slightly over the limit...

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!