public void flatten(byte flattening) {
        // If flattening is one we can skip the calculations
        // since it wouldn't change anything. (e.g. 2 power 1 = 2)
        if (flattening <= 1) {
            return;
        }

        float[] minmax = findMinMaxHeights();

        normalizeTerrain(1f);

        for (int x = 0; x < size; x++) {
            for (int y = 0; y < size; y++) {
                float flat = 1.0f;
                float original = heightData[x + y * size];

                // Flatten as many times as desired;
                for (int i = 0; i < flattening; i++) {
                    flat *= original;
                }
                heightData[x + y * size] = flat;
            }
        }

        // re-normalize back to its original height range
        float height = minmax[1] - minmax[0];
        normalizeTerrain(height);
    }
Flattens out the valleys. The flatten algorithm makes the valleys more
prominent while keeping the hills mostly intact. This effect is based on
what happens when values below one are squared. The terrain will be
normalized between 0 and 1 for this function to work.

@param flattening
           the power of flattening applied, 1 means none
jme3-terrain/src/main/java/com/jme3/terrain/heightmap/AbstractHeightMap.java