Advertisement
JontePonte

randompaste

Jul 29th, 2024
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.75 KB | None | 0 0
  1. //for (int z = 0, i = 0; z < chunkDimensions.x; z++)
  2.         //{
  3.         //    for (int x = 0; x < chunkDimensions.x; x++, i++)
  4.         //    {
  5.         //        float noise = GetNoise(x + offset.x, z + offset.y);
  6.         //        float noise01 = Remap(noise, -1, 1, 0, 1);
  7.  
  8.         //        noise *= height * curve.Evaluate(noise01);
  9.         //        noise += chunkDimensions.y / 2;
  10.  
  11.         //        for (int y = 0; y < chunkDimensions.y; y++)
  12.         //        {
  13.         //            float noise3D = Get3DNoise(x + offset.x, y, z + offset.y);
  14.  
  15.         //            //Water
  16.         //            if (y == seaLevel)
  17.         //            {
  18.         //                voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y, z)] = 5;
  19.         //            }
  20.  
  21.         //            if (y < noise + (noise3D * height * .2f))
  22.         //            {
  23.         //                voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y, z)] = 1;
  24.  
  25.         //                bool isSand = (y + 1 < seaLevel && Mathf.PerlinNoise(x * .1f, z * .1f) < sandDensity) || y < seaLevel - 3;
  26.  
  27.         //                //Add grass / sand
  28.         //                if (y + 3 < chunkDimensions.y)
  29.         //                {
  30.         //                    voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y + 1, z)] = isSand ? GetBlockIndex("Sand") : GetBlockIndex("Dirt");
  31.         //                    voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y + 2, z)] = isSand ? GetBlockIndex("Sand") : GetBlockIndex("Dirt");
  32.  
  33.         //                    voxelValues[ChunkGenerator.CalculateVoxelIndex(x, y + 3, z)] = isSand ? GetBlockIndex("Sand") : GetBlockIndex("Grass");
  34.         //                }
  35.         //            }
  36.  
  37.  
  38.         //        }
  39.         //    }
  40.         //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement