Shaders often call for the generation of random numbers. Sometimes that random number generation should form a well distributed 2D pattern (e.g. Blue noise or white noise) but other times it simply calls for generating a 32-bit random number used to make a random choice or as an index to load a random value.
Everyone writes their own function for this already (some better than others) and I believe it's something that would be worthy of being an intrinsic. A GPU may have its own source of random noise it could use to do this "more randomly" or faster than a generically written function that takes a seed. SDKs such as cuRAND exist to generate high quality random numbers of varying types and distributions.
I don't feel it necessary that the PRNGs be deterministic across vendors, but some guarantee of quality would be useful.
A uniform distribution RNG across a user-specified range would be the min-bar for what I'd hope to see supported, but other distributions such as normal would be useful to see too.
Hi,
Shaders often call for the generation of random numbers. Sometimes that random number generation should form a well distributed 2D pattern (e.g. Blue noise or white noise) but other times it simply calls for generating a 32-bit random number used to make a random choice or as an index to load a random value.
Everyone writes their own function for this already (some better than others) and I believe it's something that would be worthy of being an intrinsic. A GPU may have its own source of random noise it could use to do this "more randomly" or faster than a generically written function that takes a seed. SDKs such as cuRAND exist to generate high quality random numbers of varying types and distributions.
I don't feel it necessary that the PRNGs be deterministic across vendors, but some guarantee of quality would be useful.
A uniform distribution RNG across a user-specified range would be the min-bar for what I'd hope to see supported, but other distributions such as normal would be useful to see too.
Thanks,
Adam