Пример #1
0
        public void DiamondSquareWithFixedValueFuncCreates5X5Plane()
        {
            var map = DiamondSquare.CreateHeightMap(5, 1f);

            DiamondSquare.Apply(ref map, null, () => 0f);

            Assert.That(map, Has.All.EqualTo(1f));
        }
Пример #2
0
        public override void UpdateComponent()
        {
            float[,] heightmap = base.GetTerrainHeight();
            int resolution = base.meshGenerator.resolution;

            if (useGPU)
            {
                diamondSquare = new DiamondSquareGPU(resolution, shader);
            }
            else
            {
                diamondSquare = new DiamondSquare(resolution);
            }

            TimeLogger.Start(diamondSquare.GetType().Name, diamondSquare.Resolution);

            diamondSquare.Apply(heightmap);

            TimeLogger.RecordSingleTimeInMilliseconds();

            base.UpdateTerrainHeight(heightmap);
        }