![]() ![]() Maybe it would be nice if they were in a sorted order?įor a deeper dive into the golden ratio and irrational numbers in sampling, give this a read: Fibonacci Word Sampling If these sampling positions correspond to different places in memory, this is not great for memory caches.įurthermore, some sampling algorithms require you to visit the sample points in a sorted order – for instance, when ray marching participating media and alpha compositing the samples to make the final result. Looking at the number line, you can see that the samples come in a somewhat random (progressive) order. The golden ratio LDS has excellent convergence for 1D integration (* asterisk to be explained in next section), but the samples aren’t in a sorted order. If this is an animated image, even better results would be to use spatiotemporal blue noise for that ( ). If you are using this in screen space or texel space, better results would be to use a blue noise texture as the source of the initial random value ( ). This is true no matter what index you start in the sequence, which is a bit of a mind-bender. When viewing on a number line, or a circle, the following sample always appears in the largest gap. The golden ratio low discrepancy sequence (LDS) is a 1D sampling sequence with some excellent properties. The Golden Ratio Low Discrepancy Sequence We’ll be talking about the golden ratio low discrepancy sequence next, which has an ordering and is low discrepancy at each step. At the same time, completely random (uniform white noise) will form clumps and voids, have a high discrepancy, and leave parts of the sampling domain unsampled. This is a valuable property for sampling, with one reason being that perfectly evenly spaced points are subject to aliasing. Low discrepancy sequences have nearly evenly spaced points, but not quite. ![]() If you are wondering what low discrepancy means, discrepancy is a measurement of how evenly spaced the points are. A low discrepancy set is a set of points where all points must be used before they are low discrepancy. A low discrepancy sequence is a sequence of points with an ordering, and Wikipedia states that any subsequence starting at the first index is also low discrepancy ( ). You may wonder about the difference between a low discrepancy sequence and a low discrepancy set. A value of 1.5 goes around the circle 1.5 times and lands at the 0.5 mark. It’s as if we rolled our 0 to 1 number line segment into a circle where 1 and 0 connect. When generating low discrepancy sequences, we want to generate values between 0 and 1 through “some process.” When values outside 0 to 1 are generated, modulus brings them back in. Our actual function might want us to sample a different domain (like say between 1 and 4), but for simplicity’s sake, we generate points between 0 and 1 and map them to the different values if needed. In 1D sampling, we sample a function for x between 0 and 1. You’ll see circles talked about a lot in this post and might wonder why. It looks like φ (lowercase) or ϕ (uppercase). The golden ratio appears as the greek letter “phi,” which rhymes with pi and pie. This converges to the golden ratio and is exactly the golden ratio at infinity. If you divide a Fibonacci number by the previous Fibonacci number, you will get approximately the golden ratio 1.6180339887. The code that goes with this post is at: Golden Ratio or Fibonacci? Make up your mind!įibonacci and the golden ratio are often used interchangeably, which can be confusing but this is due to them being two sides of the same coin. ![]() This post is the result of a collaboration between myself and R4 Unit on mastodon ( R4 Unit is actually the one who showed me you could animate blue noise textures by adding the golden ratio to each pixel value every frame too some years back □ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |