Implementation for Blue-noise Dithered Sampling

Show-off, reference material & tools.
josh247
Posts: 9
Joined: Sun Mar 29, 2015 11:55 pm

Implementation for Blue-noise Dithered Sampling

Postby josh247 » Sun Jan 22, 2017 7:30 pm

Just sharing this implementation for sample mask construction required in the SIGGRAPH 2016 paper "Blue-noise Dithered Sampling" by Iliyan Georgiev and Marcos Fajardo. You can access the paper here: https://www.solidangle.com/arnold/research

As there didn't appear to be a strict implementation of the simulated annealing process found in the paper online, I thought this simple example might be helpful for someone. It should be fairly efficient using SSE3 instructions and TBB for multithreading.

https://github.com/joshbainbridge/blue-noise-generator

papaboo
Posts: 36
Joined: Fri Jun 21, 2013 10:02 am
Contact:

Re: Implementation for Blue-noise Dithered Sampling

Postby papaboo » Tue Jan 24, 2017 8:15 am

Thanks. I will definitely have a look at that. I'm currently using an LCG and that's fast but it doesn't take a lot of high frequency phenomena to break convergence. Do you have any rendering results?

jbikker
Posts: 175
Joined: Mon Nov 28, 2011 8:18 am
Contact:

Re: Implementation for Blue-noise Dithered Sampling

Postby jbikker » Tue Jan 24, 2017 2:46 pm

That is very interesting, thanks for the links!

stefan
Posts: 42
Joined: Wed Dec 21, 2011 8:57 pm

Re: Implementation for Blue-noise Dithered Sampling

Postby stefan » Wed Jan 25, 2017 2:14 pm

Thanks for sharing this. I have a Python version floating around somewhere, but that was painfully slow and then other priorities kept me from working on it.

josh247
Posts: 9
Joined: Sun Mar 29, 2015 11:55 pm

Re: Implementation for Blue-noise Dithered Sampling

Postby josh247 » Wed Jan 25, 2017 10:56 pm

Unfortunately I've not got any rendered images to share, but it shouldn't be too hard to implement. When the values are written out to the data file they are converted to an unsigned 32bit integer range. This is so that a toroidal shift can easily be applied (to particular sampling patterns) with a simple addition while taking advantage of integer overflow. Although this is assuming that the samplers are also working within the same unsigned integer range, and that the addition is done before converting the value to a floating point representation. You may also find that the current parameters are set rather low, to get a high quality result the iterations should be set much higher.

I'll try and get around to putting together some images of the fourier power spectra soon. Hopefully at some point I'll also find some time to create a simple example using pbrt v3.

jbikker
Posts: 175
Joined: Mon Nov 28, 2011 8:18 am
Contact:

Re: Implementation for Blue-noise Dithered Sampling

Postby jbikker » Thu Jan 26, 2017 8:57 am

I set the tile size to 64, iterations to 65536 * 2 and depth to 10 (for: lens, pixel, light sample 1, diffuse bounce, light sample 2); in that case the code takes about 1.5 *hours* to execute on a 12-core Xeon system (admittedly, old Xeons)... How long did your 128x128 tiles take? :)

josh247
Posts: 9
Joined: Sun Mar 29, 2015 11:55 pm

Re: Implementation for Blue-noise Dithered Sampling

Postby josh247 » Sun Jan 29, 2017 8:23 pm

I'll run the program tomorrow at a resolution of 128x128 and record the simulation time. I've not done this yet as the implementation here isn't (and does not claim to be) the same as the one found in the original paper :) There was a sizable performance gain when using AVX2 instructions, but this would have limited compatibility. As a result I've left the available code using SSE3 instructions on the master branch. Also thought it would be helpful to add a simple Fourier transform to give a better indication of the resulting quality, the images are attached.
Attachments
outputBlueNoise.png
outputBlueNoise.png (3.87 KiB) Viewed 1615 times
fourierBlueNoise.png
fourierBlueNoise.png (3.83 KiB) Viewed 1615 times

toxie
Posts: 118
Joined: Mon Nov 28, 2011 12:30 pm
Location: germany
Contact:

Re: Implementation for Blue-noise Dithered Sampling

Postby toxie » Mon Jan 30, 2017 3:14 pm

There are some minor issues getting this to work with MSVC:
a) The _mm_andnot_si128 should be a _mm_andnot_ps
b) a separate code path that uses _aligned_malloc instead of posix_memalign on MSVC
c) same for free (_aligned_free)
Maybe you can patch this then.. And thanks for sharing..
Better you leave here with your head still full of kitty cats and puppy dogs.

toxie
Posts: 118
Joined: Mon Nov 28, 2011 12:30 pm
Location: germany
Contact:

Re: Implementation for Blue-noise Dithered Sampling

Postby toxie » Mon Jan 30, 2017 4:08 pm

jbikker wrote:I set the tile size to 64, iterations to 65536 * 2 and depth to 10 (for: lens, pixel, light sample 1, diffuse bounce, light sample 2); in that case the code takes about 1.5 *hours* to execute on a 12-core Xeon system (admittedly, old Xeons)... How long did your 128x128 tiles take? :)


Would be interesting to hear your experiences when rendering with it, when optimizing for this 10D case. Cause IMHO the scheme should fall apart when using a large number of dimensions.
Better you leave here with your head still full of kitty cats and puppy dogs.

ingenious
Posts: 273
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

Re: Implementation for Blue-noise Dithered Sampling

Postby ingenious » Tue Jan 31, 2017 6:33 pm

toxie wrote:Would be interesting to hear your experiences when rendering with it, when optimizing for this 10D case. Cause IMHO the scheme should fall apart when using a large number of dimensions.


Indeed, in my experience it's hard (impossible?) to achieve high-quality blue noise in high dimensions :(
Image Click here. You'll thank me later.


Return to “Tools, Demos & Sources”

Who is online

Users browsing this forum: No registered users and 1 guest