Perlin Noise to Percentage

Viewed 2298

I'm coding a map generator based on a perlin noise and ran into a problem:

Lets say I would want 30% water and 70% dirt tiles. With a usual random generator there is no problem:

tile = rnd.nextFloat() < 0.7f ? DIRT : WATER;

But a perlin noise is normal distributed (ranges from -1 to 1, mean at 0) so it's not that easy.

Does anyone know a way to transform a normal to an uniform distribution or a different way I could get a percentage from a noise value?

EDIT: The 70% are just an example, I'd want to be able to use any value dynamically, at best with 0.1% precision.

EDIT2: I want to transformate perlin noise to a uniform distribution, not to normal (which it already is alike).

6 Answers
Related