Example #1
0
        private float Elevation(Vector3 pointOnSphere)
        {
            float firstLayerValue = 0;
            float elevation       = 0;

            if (simpleNoiseGenerators.Length > 0)
            {
                firstLayerValue = simpleNoiseGenerators[0].Evaluate(pointOnSphere);
                if (settings.noiseLayers[0].enabled)
                {
                    elevation = firstLayerValue;
                }
            }

            for (int i = 1; i < simpleNoiseGenerators.Length; i++)
            {
                if (!settings.noiseLayers[i].enabled)
                {
                    continue;
                }

                float mask = settings.noiseLayers[i].useFirstLayerAsMask ? firstLayerValue : 1;
                elevation += simpleNoiseGenerators[i].Evaluate(pointOnSphere) * mask;
            }
            elevationMinMax.EvaluateValue(elevation);
            return(elevation);
        }