x


Voxel Terrain

I'm asking this question because for my next project I need to implement a voxel terrain engine similar to that used in CryEngine 2. Because I need to make caves, no I have a mental system for how this could possibly work but if it does not could you suggest a work around?

My system is where the editor has an editing tool where I can instantiate low poly balls on top of each other without depleting to much memory. The way I found around that would be to use some sort of occlusion where it destroys certain balls on the inside

For example if I had three balls but you could not see the third then destroy the third ball since it is not needed.

more ▼

asked Nov 30, 2011 at 12:34 AM

DarkKobra2020 gravatar image

DarkKobra2020
48 18 12 15

Sorry, I read this post and all I could see was "I need to write CryEngine 2"...

Nov 30, 2011 at 12:03 PM syclamoth
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

If you want to do it yourself, look for Marching Cubes algorithm. It may take a day or two to wrap your head around, depending on your skill level. I managed to get this going the first day, and this going the second day. Third day I got bored and discontinued development of it.

Your idea of balls should be pretty simple to implement with marching cubes. Imagine each vertex has to sample a value (usually between 0 and 1) and that value is used to extend/retract the vertex for that point in space. Your balls would then interpolate from 1 to 0 where value 1 is in the center, and 0 is in the ball crust. Basically, you just have to check the magnitude.

I solved texturing by using a triplanar shader, requiring no UV coordinates. It just take the world position and project 3 textures on it, and interpolate between the textures depending on the normal.

more ▼

answered Nov 30, 2011 at 01:27 PM

Statement gravatar image

Statement
26.2k 76 114 252

Statement. That Clayful thing you made is fantastic Honestly! You must create a tutorial On how to do it! Ive been looking for Unity voxel tutorials that arent like Minecraft blocks.

Jan 25, 2013 at 09:40 PM CubePhysics

Would you consider posting the code? That might help those who still strive :)

Dec 14, 2011 at 05:25 PM 0xc0dec
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2431
x132
x73

asked: Nov 30, 2011 at 12:34 AM

Seen: 7444 times

Last Updated: Jan 25, 2013 at 09:40 PM