Last active
January 8, 2021 12:55
wang hash -> shader hashing fuction (http://www.reedbeta.com/blog/quick-and-easy-gpu-random-numbers-in-d3d11/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint wang_hash(uint seed) | |
{ | |
seed = (seed ^ 61) ^ (seed >> 16); | |
seed *= 9; | |
seed = seed ^ (seed >> 4); | |
seed *= 0x27d4eb2d; | |
seed = seed ^ (seed >> 15); | |
return seed; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what seed do you usually use with this?