0
\$\begingroup\$

I am working on a voxel engine. Currently my cubes are rendered as vbos. I thought, it may be better to load only the cooridinates of voxels to the shader and make it draw a cube itself. Can someone tell me, if thats possible, and if so, how?

\$\endgroup\$
1
\$\begingroup\$

I am currently working on a voxel engine as well. And I have found a few interesting conclusions:

  1. Have 6 different vbo's one for each side (each vbo has contains the vertices of all the blocks which you want to render). A vbo has 4 vertices (connect them to form triangles with an index buffer) per block which contains color information and possibly also lightning information.
  2. You can subdivide your world into different chunks and generate a vbo per chunk each time that a chunk is changed. Or you can generate your vbo per frame and just add everything which is visible to the camera.
  3. Greedy mesh generation resulted (for me) into a 80% performance boost (I generate my vbo's each frame (for now)).

In a question of mine is my code for generating the meshes, this might also help you understand how I render my voxels. I´m not implying that my method is the best method, but this has worked for me (so far).

Here are a few of my sources (which I used to come to these conclusions):

PS: This is not really an answer to the question you asked, but a suggestion. It is what I think is a better alternative.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.