Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //for (int z = 0, i = 0; z < chunkDimensions.x; z++)
- //{
- // for (int x = 0; x < chunkDimensions.x; x++, i++)
- // {
- // float noise = GetNoise(x + offset.x, z + offset.y);
- // float noise01 = Remap(noise, -1, 1, 0, 1);
- // noise *= height * curve.Evaluate(noise01);
- // noise += chunkDimensions.y / 2;
- // for (int y = 0; y < chunkDimensions.y; y++)
- // {
- // float noise3D = Get3DNoise(x + offset.x, y, z + offset.y);
- // //Water
- // if (y == seaLevel)
- // {
- // voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y, z)] = 5;
- // }
- // if (y < noise + (noise3D * height * .2f))
- // {
- // voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y, z)] = 1;
- // bool isSand = (y + 1 < seaLevel && Mathf.PerlinNoise(x * .1f, z * .1f) < sandDensity) || y < seaLevel - 3;
- // //Add grass / sand
- // if (y + 3 < chunkDimensions.y)
- // {
- // voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y + 1, z)] = isSand ? GetBlockIndex("Sand") : GetBlockIndex("Dirt");
- // voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y + 2, z)] = isSand ? GetBlockIndex("Sand") : GetBlockIndex("Dirt");
- // voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y + 3, z)] = isSand ? GetBlockIndex("Sand") : GetBlockIndex("Grass");
- // }
- // }
- // }
- // }
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement