Some ways I know of creating blue noise distributed samples are:
- Void and Cluster – This creates a greyscale blue noise texture that can be thresholded to create blue noise sample points of the desired density. More info: http://momentsingraphics.de/?p=127
- Filtering White Noise – This uses repeated iterations of filtering and histogram fixup to make blue noise (and other colors as well). More info: https://blog.demofox.org/2017/10/25/transmuting-white-noise-to-blue-red-green-purple/
- Mitchell’s Best Candidate Algorithm – This uses a variation on dart throwing to pick some points at random, and choose whichever point preserves the blueness of the samples best. More info: https://blog.demofox.org/2017/10/20/generating-blue-noise-sample-points-with-mitchells-best-candidate-algorithm/
To be honest, the void and cluster algorithm is a “top tier” algorithm while filtering white noise is just kind of a hack, and Mitchell’s best candidate algorithm is decent, simple but a bit out dated too.
Let’s look at some 128×128 blue noise textures created via void and cluster (top) and white noise filtering (bottom). The images on the right are the frequencies of the images (DFT magnitude). Since blue noise is high frequency noise, having a darker middle means a higher quality result.
Note: the white noise filtering used 25 iterations and a sigma of 1.5 for the blurring.
They look pretty similar don’t they? It turns out they are actually pretty different which I found really surprising when I was told. I had to see this for myself.
Below we threshold both images to 10%. What I mean by that is that if we consider black to be 0 and white to be 1, we make an image where there is a black dot if the color is < 0.1, else we make a white dot.
Void and cluster is top, and white noise filtering is middle. On the bottom is blue noise sample points generated with a discrete version of Mitchell's best candidate algorithm.
As you can see, the filtered white noise has already fallen apart for our purposes. It's basically unusable for this usage case. Mitchell is doing fairly ok though.
Mitchell is gaining some low frequencies (it isn't as dark in the middle) but the filtered white noise is starting to look a tiny bit better.
Here are the rest up to 90%:
So, void and cluster beat the pants off the other two methods.
Filtered white noise used for this purpose is no good and basically fell completely apart.
Mitchell was decent until the sample density got too high and then it failed. There are some parameters to tune with this algorithm so it's possible that it could do better, but in general the algorithm does poorly for high point densities. As an alternative, above 50% density, you could perhaps invert the colors and treat it as 100-density so that it was always working against < 50% density. Even at 50% density, it isn't that great though, at least with my setup.
shadertoy.com recently got a blue noise texture and luckily the blue noise texture was made with the void and cluster algorithm, so it's "the good stuff".
Another family of algorithms to generate blue noise are based on constrained Voronoi diagrams and relaxation to evolve starting sample points to be more blue. Those are good for generating specific point sets for a specific density, but differ from void and cluster which are designed to make a texture that works well for any density.
There are other algorithms out there as well with different properties, and new ones coming out all the time. SIGGRAPH is starting right now and I bet at least one or two new blue noise algorithms are shown 😛
Have any interesting blue noise info to share? I'd love to hear it! It feels like the rabbit hole here is a lot deeper than it seems.
Pingback: Wolfenstein: Raytracing ON using WebGL1 - reindernijhoff.net
Pingback: Wolfenstein: Ray Tracing On using WebGL1
Pingback: Wolfenstein: Ray Tracing On using WebGL1 - NewsUcan2Use
Pingback: Generating Blue Noise Textures With Void And Cluster « The blog at the bottom of the sea
Pingback: ray tracing using WebGL1 / geek magazine – Designers story
Pingback: Not All Blue Noise is Created Equal Part 2 « The blog at the bottom of the sea