LWJGL VBO vertices amount

I have this map viewer, in which you can zoom out really far.
Basically the way it is setup at the moment is I put all the vertices data into 1 VBO and render it to the screen. I update the VBO when player moves/zooms the map.

I currently have my VBO with 20000 quads (80000 vertices) rendering, and it is far from enough. Is this normal? I mean, how much vertices should I limit myself to? Because I’m thinking I will need like close to 500000 vertices to view the map at max zoom.

I guess the question here is what is an optimal size for a VBO? Or rather, is there a downside to using this ONE huge interleaved VBO over few smaller ones?

EDIT-
I feel like I’m putting like 1.5 million vertices, 8 float / vertex into 1 single VBO. Is this OK to do? :smiley:
EDIT–
It seems I was really doing something wrong. I think I’m at 300k static vertices for terrain right now.
EDIT—
Now my question is should I try to optimize this and make multiple VBOs. Would that enhance the performance?

I was working on a very similar project:

In summary:

  • there are limits on the size of a VBO
  • however it appears to be vendor-specific
  • there is no guaranteed method to query for this limit
  • at some point you will need to use multiple VBO ‘chunks’ to render your map
  • the anecdotal optimal size for a chunk is something around the 4Mb mark

So how many floats fit into 4 mb? 1mil?

Yeah just over a million. I’d choose a VBO size with that ~4Mb limit in mind.

If you’re interested why 256 x 256 chunks in my example:
each vertex has eight floats (3 for position, 3 for normal, 2 for texture coordinates) = 24 bytes per vertex
assuming a 4Mb limit means I could fit ~175K vertices in a single VBO.
256 x 256 is well inside this ‘limit’, 512 x 512 exceeds it.

There, FTFY :point:

With shaders you can easily limit the number of bits per vertex attribute.

You can use unsigned-shorts for normals and signed-shorts for texcoords. For a terrain tile grid, it’s very likely that you can equally reduce your coordinates to unsigned-short values (maybe even signed-bytes for X and Z axis). Just send the offset vector and scale vector to the shader as uniforms and calculate the ‘real’ values in the vertex shader. With this simple approach you cut your data size in half (or more), and even 512x512 fits nicely.

[quote=“trollwarrior1,post:1,topic:48090”]
You should have about as much vertices as you have quads. Use index buffers to reuse vertices.