Jump to content
  • Advertisement
Sign in to follow this  
TosKeN

OpenGL Using only a few indices of a big VBOs

This topic is 4067 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 all, i have a question regarding OpenGL VBOs. I am currently working on a very basic terrain rendering engine. I use one big VBO for the vertex data which holds the vertices of the whole terrain mesh. Now i try to get a simple frustum culling working. A quad tree hierarchically divides the mesh in tiles with the size 33x33. And every leaf of the tree holds the associated indices only for this tile. Is it now possible to bind the vertex buffer which holds the data for the whole terrain and then call sequential glDrawElements with only the indices of the tiles that are in the frustum ? Are there any performance issues? Or is it better to have a seperate vbo with the vertex data for every tile of the terrain in the quad tree like the indice arrays? Thank you

Share this post


Link to post
Share on other sites
Advertisement
Your VBO shouldn't be bigger then 64K vertices, because some GPUs are faster (or limited) with short indices.
If your terrain needs more than 64K vertices split it by material or different shader.
Using only a part of a VBO is not a problem, but it's recommend that the accessed vertices are in a linear order. Random access could slow down the data fetching. (Note that the last 16-24 vertices are cached.)


Sometimes it's better to render the full mesh, instead splitting it into to small batches. A draw call should not be lower than 500-1000 triangles.

A good idea on vertexshader limited Terrain renders is to rebuild the index after some frames (remove unneeded vertices). It's also a good idea to order the triangles from front to back, to relieve the fragmentshader from overdraws.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!