tag:blogger.com,1999:blog-1667313809239009473.post1101290519638943025..comments2017-08-07T10:34:26.459+02:00Comments on runevision blog: Primer on Repeatable Random NumbersRune Skovbo Johansenhttp://www.blogger.com/profile/10793811736803423054noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-1667313809239009473.post-83366501925274370422015-02-03T16:35:00.815+01:002015-02-03T16:35:00.815+01:00Anonymous: Yes, they will work on 64-bit systems a...Anonymous: Yes, they will work on 64-bit systems as well, and the results will be identical. The int type in .Net always means Int32 regardless of architecture.<br /><br />Both Int32 and Int64 can be used on either 32 bit or 64 bit architectures. The differences are only in performance, though I'm not enough of an expert myself to comment on the details of that.Rune Skovbo Johansenhttps://www.blogger.com/profile/10793811736803423054noreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-25612025606214442562015-02-03T15:18:23.365+01:002015-02-03T15:18:23.365+01:00I'm to unfamiliar with the differences between...I'm to unfamiliar with the differences between 32 and 64 bit computing, but do these functions/your implementations work on 64 bit systems?<br /><br />Maybe more specifically with Unity's IL2CPP that compiles into 64 bit apps on iOS?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-58894641059369196352015-01-28T17:19:33.335+01:002015-01-28T17:19:33.335+01:00@Anonymous, it's adding together the pixel val...@Anonymous, it's adding together the pixel values in each diagonal line. If some of these sums are a lot different from the others, the variance will be high. If they are all close to each other (as expected for random output), it will be low.Rune Skovbo Johansenhttps://www.blogger.com/profile/10793811736803423054noreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-46871310054150536182015-01-28T16:56:40.162+01:002015-01-28T16:56:40.162+01:00Could you also please explain this:
"The lat...Could you also please explain this:<br /><br />"The latter looks at sums of diagonal lines of pixels from the coordinate plot and measures the standard deviation of these sums."?<br /><br />thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-32063112264881726872015-01-06T17:14:36.060+01:002015-01-06T17:14:36.060+01:00@Bram Right. Tiny Mersenne Twister (TinyMT) is a r...@Bram Right. Tiny Mersenne Twister (TinyMT) is a random number generator, and I didn't yet dive into a lot of comparisons of those. (I focused mostly on performance of hash functions.)<br /><br />It's good to hear you've had good results with TinyMTRune Skovbo Johansenhttps://www.blogger.com/profile/10793811736803423054noreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-43003944156984329952015-01-06T16:52:46.477+01:002015-01-06T16:52:46.477+01:00Rune, thanks for sharing this great article.
I am...Rune, thanks for sharing this great article. <br />I am currently struggling with my photon mapper that needs random directions from a lightsource.<br />But I want it to be fast, and still look good.<br />That is harder than I initially thought.<br />So far, I see the best result with TinyMT.Bram Stolkhttps://www.blogger.com/profile/07666511303597120943noreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-22330171566393861072015-01-02T21:55:12.805+01:002015-01-02T21:55:12.805+01:00@Benoit, it's just about getting random number...@Benoit, it's just about getting random numbers to choose random pixels in the image to brighten.<br /><br />Instead of having a fixed pixel and determining the color of that pixel, the random numbers are used to determine which pixels to affect in the first place.<br /><br />You can see the actual test code on BitBucket <a href="https://bitbucket.org/runevision/random-numbers-testing/src/4a4e42b70b8511e1e570214b53ea0cd13f294641/Assets/Testing/RandomHashTest.cs?at=default" rel="nofollow">here</a>.Rune Skovbo Johansenhttps://www.blogger.com/profile/10793811736803423054noreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-85530368740392668352015-01-02T18:24:04.245+01:002015-01-02T18:24:04.245+01:00I didn't really get that part: "An altern...I didn't really get that part: "An alternative way to inspect the random output is to create 2D coordinates from pairs of the random numbers and plot those coordinates into an image."<br />Care to elaborate, or dump some pseudo-code maybe?Benoit FOULETIERhttps://www.blogger.com/profile/10932255290532790365noreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-14872006203513598982015-01-02T01:23:58.772+01:002015-01-02T01:23:58.772+01:00@Nathan, thanks for the suggestions!
I tested Wa...@Nathan, thanks for the suggestions! <br /><br />I tested Wang hash (see image here https://twitter.com/runevisioncom/status/550796046763560960 ) and it looks insufficiently random on its own, but if called twice (feeding its output to itself) it becomes very random and is still very fast.<br /><br />I also tested Xorshift RNG. Quality seems great as long as the initial state isn't 0 (in which case it fails completely).<br /><br />I'll update the blog post with new results when I get the chance.Rune Skovbo Johansenhttps://www.blogger.com/profile/10793811736803423054noreply@blogger.comtag:blogger.com,1999:blog-1667313809239009473.post-18127584518158492682015-01-01T21:54:53.261+01:002015-01-01T21:54:53.261+01:00I'm a fan of Xorshift for an RNG, and the Wang...I'm a fan of Xorshift for an RNG, and the Wang hash for a simple, fast 32-bit hash function. I blogged about them <a href="http://www.reedbeta.com/blog/2013/01/12/quick-and-easy-gpu-random-numbers-in-d3d11/" rel="nofollow">here</a>. They have the advantage of being very, very fast and simple, and natively working on 32-bit values as input and output - unlike things like MD5 and MurmurHash, which are designed to digest a whole variable-length array of data and have extra complexity because of that, and also output 64-bit or 128-bit results. Xorshift and the Wang hash are even lightweight enough to use in GPU shaders. Of course, everyone has their favorite RNG/hash functions, but maybe these are worth considering. :)Nathan Reedhttp://reedbeta.comnoreply@blogger.com