Store static environment in chunks

I have a relief separated by chunks and I would like to place environments (like rocks, trees, etc.) in each chunk at random.

My question is related to how to implement such a system in OpenGL.

What I have tried:

  • Solution : draw the environment with the instance once for the entire terrain (not for a specific fragment)

    Problem : I, besides a chunk, sometimes take a bit to load, and since I am using streams, the environment will appear as floating.

  • Solution . Draw the environment with instancing for each slice.

    Problem . To draw each piece, I will need to bind the VBO to the piece, draw the piece, bind the VBO to the environment (and probably the VAO), and draw it.

    I don't want to put so many glBindBuffer functions because I heard it is slow (please correct me if I'm wrong)

  • (Not Tried) Solution : somehow merge the vertices of the landscape with the environment and merge them.

    Problem: My terrain is drawn with GL_TRIANGLE_STRIP, so this is the first problem, the second problem (?) Is that I don't know how much it will function (speaking speed).

I tried looking for solutions on the internet but didn't seem to find anything related to chunks.

Does anyone know how other games that use chunks do this? Is there a way to do this without causing a lot of speed reduction?

+3


source to share





All Articles