# How to use the float value from noise function in voxel terrain?

I'm using Unity, although this question is not really specific to that engine.

Im also using an asset from the store called Coherent Noise. It has some neat noise functionality built it.

I am using those functions to produce some noise values. I am getting a value between 0 and 1 (floats).

I have an array of blocks (for minecraft like voxel terrain) and I am confused on how to use this float value for terrain?

Do I do something like <= 0 == Solid block etc?

I am confused on how to use the floating values that the noise functions produce to use for height values of an array of say a height of 16.

• Are you generating 2d or 3d noise? – Raven Dreamer Nov 18 '12 at 6:20
• I am trying ti implement 3D. – therealjohn Nov 18 '12 at 13:35

The second option is going to be harder to get right. You'll need to implement the noise generation in a controlled manner. i.e. you'll want to have voxels more likely to be solid at small y values and more likely to be air at large y vaules. If it's completely random you'll have land and ground so mixed up the landscape won't resemble landscape at all. See my answer here to learn more about implementing terrain using noise as a density function.