Skip to content

Instantly share code, notes, and snippets.

@jamesrobinsonvfx
Last active August 20, 2021 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesrobinsonvfx/39907b3977f2f020843da6bc97c57417 to your computer and use it in GitHub Desktop.
Save jamesrobinsonvfx/39907b3977f2f020843da6bc97c57417 to your computer and use it in GitHub Desktop.
Pick a random value of a bitmask per point
int num_choices = 5;
int idx = floor(rand(i@id + 65536) * num_choices);
i@bitmask = int(pow(2, idx));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment