Skip to content

Instantly share code, notes, and snippets.

@breakin
Created July 12, 2018 20:48
Show Gist options
  • Save breakin/0ff700a3db58decd0cacd8c01d52b64b to your computer and use it in GitHub Desktop.
Save breakin/0ff700a3db58decd0cacd8c01d52b64b to your computer and use it in GitHub Desktop.
Progressive blue noise
Making a bit longer writeup here.
Lets say you restart rendering each time camera/objects moves. Ideal for a viewport in a 3d-editor when there is no animation happening.
Move a light source and you get noisy rendering that improves.
Lets say we want to do 256 samples per pixel, one at the time. We show result to user after each sample.
We construct a big table of blue noise for one pixel. Then we will scramble (that is the word used in papers) it somehow based on x,y to create different sequences for other pixels.
Think of a space that is wrapping in X but not in Y. X represents phi and Y theta on the hemisphere.
Algorithm (dart-throwing) then is:
1. Set global radius to say 0.5 (1.0 is full space)
2. Try to place a circle of the global radius with no old sample inside the circle (radius of the old sample doesn't matter)
3a. If fail, reduce global radius and goto 2
3b. Is success save the sample position
4. Repeat 2 256 times :)
The sequence [1,2,...N] will be roughly blue noise independant of N.
I'm always confused when I see fast blue-noise generation papers since they seem to ignore this last property. But it doesn't matter for all applications, it just happened to be important for what I did.
@breakin
Copy link
Author

breakin commented Jul 12, 2018

A side note. Jittering is really nice if you know you want to do N samples. But you need to fix N to something to divide up your domain into N pieces. And when N is done and you want to do N more you will have sampled N cells twice, not sampled 2N cells which would have been better. I assume the multi-correlated jittering paper looks at that!

@breakin
Copy link
Author

breakin commented Jul 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment