Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added function to randomize permutation table at runtime #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jamescamdenmartin
Copy link
Contributor

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.

James Martin added 2 commits August 24, 2018 12:02
…e the permutation table at runtime, similar to the pure python implementation
@caseman
Copy link
Owner

caseman commented Nov 9, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants