public float GetAltitude(Vector3 pos, float baseRadius) { //Sample float surface = noise.Sum(pos, surfaceShape); float detail = noise.Sum(pos, hillNoise); float mountains = noise.Sum(pos, mountainNoise); float diff = mountains < detail ? 0 : (mountains - detail); //Blend float delta = detail * hillHeight; /*(detail > mountains) * ? detail * hillHeight * : (diff < blendAmount * ? Mathf.Lerp(detail * hillHeight, mountains * mountainHeight, Mathf.Clamp01(diff / blendAmount)) * : mountains * mountainHeight);*/ float combined = (surface > seaLevel) ? (surface * continentHeight) + delta : (surface * continentHeight); //Assign return(baseRadius + combined); }