noise icon indicating copy to clipboard operation
noise copied to clipboard

Added function to randomize permutation table at runtime

Open jamescamdenmartin opened this issue 6 years ago • 1 comments

Added a randomize(period, seed) function to change the permutation table at run-time in the C implementation, similar to the randomize function in the pure python implementation.

Also fixed a typo in py_noise4 where lacunarity was left out of the python args.

jamescamdenmartin avatar Aug 24 '18 17:08 jamescamdenmartin

Thanks for the PR, sorry it languished so long, I didn't see the notification and wasn't paying good attention to this repo.

I merged the lacunarity fix, thanks.

I generally like the randomize() feature but it needs some more work before I can merge:

  • Fix build warnings: warning: incompatible pointer types assigning to 'unsigned char *' from 'unsigned char (*)[512]'

  • Do some profiling to ensure that the change from using & to % isn't a performance killer. Division is pretty slow compared to bit masking.

  • Add unit test) for randomize(), particularly to ensure different periods (non power of 2 and power of 2) work, and that choosing the same seed gives consistent output.

Thanks again.

caseman avatar Nov 09 '18 23:11 caseman