Voxel Terrain Performance (rendering)

Started by
6 comments, last by Waterlimon 10 years, 10 months ago

Hello all,

I'm trying to find out some opinions related to rendering techniques for a procedural minecraft like terrain system made of cubes. It's just a toy and a learning experience for me.

So, my question for the community is how to store/use textures in regards to the vertices in question. It'd be fewer vertices for certain if I merge adjacent faces that would use the same image. The only way I know to do this without a buffer per image would be to abuse the wrapping capabilities of the graphics card by storing faces in strips. Then I could use a vertical strip and a horizontal strip of possible face images as two atlases depending on if the faces are merged vertically or horizontally.

I could also simply use a typical atlas map with 4 vertices per face. It's simple, works well, and there's no tricks going on that might result in more texture swapping than desirable.

Any other possibilities anyone else knows of that might be a performance increase? If nothing else, I'm considering storing a vertex buffer per face normal (that's 6 buffers) per chunk and rendering those individually to perform a software like backface culling. Depending on the chunk size, that might be a decrease or an increase in performance (overhead of draw calls).. not too sure.

Advertisement
Go with the simple approach until it works.

Then use something like a geometry shader to only send:
-The integer position of each visible cube
-The face/cube material(s)
-Face visibilities

and it assembles the cube faces on GPU

o3o

@Waterlimon

I'm actually using C# with XNA. It doesn't support Geometry Shaders. Thanks though.

I wouldnt combine faces though. It will work only in some soecific situations but has a performance hit and imposes limitations on your system.

You cant use a texture atlas for example, and changing a face texture requires regeneration of the whole chunk mesh instead of individual vertex data.

o3o

Can you use texture arrays? It would solve the tiling problem with merged faces.

Possibly, but it still might not be the best idea. What if you want per voxel lighting like in minecraft? I think that needs individual faces to work without using ugly hax.

o3o

Also, XNA doesn't support texture arrays.

Youll be better off just doing the simple one quad per face approach with the normal optimizations (dont generate face if it faces opaque voxel)

Then you should look into LoD techniques, occlusion culling, perhaps some sort of an impostor optimization for far away chunks...

Those will provide performance increases far higher than combining faces. Combining faces might reduce polygon count by 5%, but LoD can cut it by hundreds of percents in some cases.

Occlusion culling can hide entire chunks if you use chunks.

Impostors for far away chunks is LoD but for changes due to change in relative orientation/position which change what the rendered mesh looks like.

Do at least the first two, then bother with combining faces if you still have situations where its effective.

o3o

This topic is closed to new replies.

Advertisement