Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do Perlin noise algorithms use lookup tables for random numbers

I have been researching noise algorithms for a library I wish to build, and have started with Perlin noise (more accurately Simplex noise, I want to work with arbitrary dimensions, or at least up to 6). Reading Simplex noise demystified, helped, but looking through the implementations at the end, i saw a big lookup table named perm.

In the code example, it seems to be used to generate indexes into a set of gradients, but the method seems odd. I assume that the table is just there to provide 1) determinism, and 2) a speed boost.

My question is, does the perm lookup table have any auxiliary meaning or purpose, or it there for the reasons above? Or another way, is there a specific reason that a pseudo-random number generator is not used, other than performance?

like image 440
Aatch Avatar asked Nov 04 '22 03:11

Aatch


1 Answers

This is a bytes array. The range is 0 to 255. You may randomize it if you want. You will probably want to seed the random... etc.

like image 82
Vincent Avatar answered Dec 15 '22 11:12

Vincent