Question about noise function return ranges: I am extensively using noise8() in my code,

Question about noise function return ranges:

I am extensively using noise8() in my code, and I found that it seems to return values heavily biased toward the middle of the range (120). I made a loop that iterated 100k times and tested the min/max of noise8() calls using random x and y and z values. I found that the value never dipped below ~60 (this is from memory so could be off a bit), and didn’t generally go all the way up to 255.

Is this by design? In my experience with simplex/perlin noise, it returns values in the full range. I’ve “solved” the problem by rescaling the return value, but it bothers me and I’d rather do it “right”. Thanks!

See how @Mark_Kriegsman did it here: https://github.com/FastLED/FastLED/blob/master/examples/NoisePlusPalette/NoisePlusPalette.ino#L98-L100

Ah, thanks very much, @Jon_Burroughs !

Yeah, it’s a trade off, balance vs. maximizing range - doing all the math in 8/16 bit limits the ranges that I’ve got (and I tried very hard to keep the noise functions from drifting up into 16/32 bit math). Ahh, the joy of fixed point math :slight_smile:

That makes perfect sense. The 8-bit math noise functions are a godsend, and they are so fast I can do >2100 calculations per frame and still get >50fps. Thank you so much! My attempts at optimizing simplex noise functions were mediocre and frustrating.