Jump to content

  • Log In with Google      Sign In   
  • Create Account


Voxel Terrain Performance (rendering)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Mythix   Members   -  Reputation: 122

Like
0Likes
Like

Posted 19 June 2013 - 10:25 AM

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.



Sponsor:

#2 Waterlimon   Crossbones+   -  Reputation: 2355

Like
0Likes
Like

Posted 19 June 2013 - 01:33 PM

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

Waterlimon (imagine this is handwritten please)


#3 Mythix   Members   -  Reputation: 122

Like
0Likes
Like

Posted 19 June 2013 - 03:57 PM

@Waterlimon

 

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



#4 Waterlimon   Crossbones+   -  Reputation: 2355

Like
0Likes
Like

Posted 20 June 2013 - 08:02 AM

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.

Waterlimon (imagine this is handwritten please)


#5 Elchi   Members   -  Reputation: 780

Like
0Likes
Like

Posted 20 June 2013 - 01:28 PM

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

 

 



#6 Waterlimon   Crossbones+   -  Reputation: 2355

Like
0Likes
Like

Posted 20 June 2013 - 01:52 PM

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.

Waterlimon (imagine this is handwritten please)


#7 phil_t   Crossbones+   -  Reputation: 3193

Like
0Likes
Like

Posted 20 June 2013 - 01:54 PM

Also, XNA doesn't support texture arrays.



#8 Waterlimon   Crossbones+   -  Reputation: 2355

Like
0Likes
Like

Posted 20 June 2013 - 02:44 PM

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.

Waterlimon (imagine this is handwritten please)





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS