Реклама
Fast And Easy GPU Random Numbers In D3D11 - Nathan Reed’s Coding Weblog
  • Дата: 16-03-2023, 13:10
Observe: please see the 2021 replace to this submit, here. In games and graphics one typically must generate pseudorandom numbers. Needless to say, PRNGs are an especially well-researched topic; nevertheless, nearly all of the literature focuses on applications with very exacting high quality necessities: cryptography, high-dimensional Monte Carlo simulations, and suchlike. These PRNGs are likely to have lots of of bytes of state and take lots of of instructions to replace. That’s manner overkill for many extra modest functions-when you simply wish to perform a little random sampling in a recreation context, you can most likely get away with a lot less. To drive home just how much decrease my random quantity requirements can be for this article, I’m not going to run a single statistical take a look at on the numbers I generate-I’m just going to take a look at them! The human visible system is pretty good at picking out patterns in what we see, so if we generate a bitmap with one random bit per pixel, black or white, it’s easy to see if we’re generating "pretty random" numbers-or if something’s going incorrect.
Просмотров: 14  |  Комментариев: (0)