[quote]What exactly is noise(x)?
[/quote]
I’ve been wondering the same thing. As far as I can tell, the range noise(0) to noise(1) is going to have the same general degree of randomness as the range noise(100) to noise(101)–just translated to a different set of points on the noise field. How one relates those differences to a width of a graphic on the screen or to a given number of pixels depends on the scaling function used.
So if a graphic has width W, any you use (x / W) as the argument to the noise function (where x is some value between 0 and W), you will be feeding the values that range from 0 to 1 to the noise function. Thus two graphics of different widths will have results where the texture looks scaled when comparing them.
There is undoubtedly an absolute number N that represents the “period” of the noise, inasmuch as a random function can have a period. But I don’t know what that is yet, and it is probably different for ImprovedNoise vs Simplex noise. Surely it is related to the spacing of the random gradients.
[quote]I’ve never heard about log1p… what curve does it give, if I feed x values ranging from 0 to 1 to the function? You say they range from 0 to 0.693, but in which way?
[/quote]
The function is f(x) = ln(x+1), which is the inverse of f(x) = e^(x+1).
Math.log1p(0) = 1, Math.log1p(1) = 0.693.
http://docs.oracle.com/javase/7/docs/api/index.html
I came across it when trying to come up with a natural growth distribution for the brightness of the stars in my “procedural night sky”. The function returns the natural log of a given number + 1. Since ln(0) is infinity, this is a bit more convenient to use than the Math.log() function. Note also that ln(1) = 0. (Any number, including e, to the 0th power = 1.)
I wanted dim or small stars to be more likely to occur than bright stars, and I wanted the distribution to reflect exponential growth. I came up with this bit of code to accomplish this:
// choose size (five sizes possible)
int size = 4 - (int)Math.log1p(random.nextInt(148));
This is based on the fact that 148 = (roughly) e^5. By using the Math.log1p() version, I didn’t have to eliminate 0 as an output of the random.nextInt() function.
But it seems you were after something different and you found it.