Implementation for Blue-noise Dithered Sampling

Show-off, reference material & tools.
jbikker
Posts: 175
Joined: Mon Nov 28, 2011 8:18 am
Contact:

Re: Implementation for Blue-noise Dithered Sampling

Postby jbikker » Tue Jan 31, 2017 8:07 pm

It's currently improving my 128^2 tile... Spent 78 hours so far. :) Added progress counter and resume functionality. I'll report when I have something running, but it's going to be after the weekend; tracer is broken atm due to some BSDF experiments.

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

Re: Implementation for Blue-noise Dithered Sampling

Postby josh247 » Wed Feb 01, 2017 11:20 pm

Good catch on that instruction toxie, I've pushed up a fix for this. I'd not thought about MSVC support but it's a good point, this should also be working now. Although saying that, I've not got a windows environment to test this on. So if anyone does, and tries compiling the source, then let us know the result.

I've also tried simulating 128x128 sample mask at a depth of 4, and got some comparable results to that displayed in the paper. This took 12 hours with 131072 iterations, although that was on a relatively modern Xeon with 8 cores (16 threads). Would be interested to see what we get with more iterations, let us know what you find jbikker :)

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

Re: Implementation for Blue-noise Dithered Sampling

Postby josh247 » Wed Feb 01, 2017 11:37 pm

ingenious wrote:
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 :(

I'd imagine the benefit of the blue noise properties would give diminishing returns with greater depth rather quickly. And as you say, a higher depth value will also produce a sample mask of lower quality. This approach will probably be best suited to dealing with earlier integration problems such as motion blur or spectral sampling. Although they did give an example of good results with light sampling.

If higher dimensions are required then we might see better results by padding multiple sample masks of a low depth, each using a different seed value.

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

Re: Implementation for Blue-noise Dithered Sampling

Postby toxie » Thu Feb 02, 2017 10:44 am

To be honest, i don't even know if it can bring any real benefit for anything that is not directly visible from the camera. After all one exploits the human visual system here, so the higher dimensions/bounces should be better tackled via a properly distributed sample set (e.g. most likely some modern QMC set or another "hand-optimized" set with a fixed number of samples, especially if one tackles interactive/realtime usage).
Better you leave here with your head still full of kitty cats and puppy dogs.

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

Re: Implementation for Blue-noise Dithered Sampling

Postby papaboo » Thu Feb 02, 2017 10:48 am

Wouldn't it yield some improvement if the first surface the ray intersects is nearly or completely specular? In that case the noise-buildup doesn't really start until the second intersection.

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

Re: Implementation for Blue-noise Dithered Sampling

Postby toxie » Thu Feb 02, 2017 10:53 am

Yup, that too, of course.
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 » Thu Feb 02, 2017 3:59 pm

toxie wrote:To be honest, i don't even know if it can bring any real benefit for anything that is not directly visible from the camera. After all one exploits the human visual system here, so the higher dimensions/bounces should be better tackled via a properly distributed sample set (e.g. most likely some modern QMC set or another "hand-optimized" set with a fixed number of samples, especially if one tackles interactive/realtime usage).


Dithering aims to improve is the correlation between the pixel estimates so that the distribution of the error is visually pleasing. It does not address the quality of these estimates, i.e. the amount of error. Of course, for each pixel you want to use a good integration pattern, e.g. a QMC one, to lower the amount of error, but that's an orthogonal objective. The two objectives can be combined.

For example, while motion blur and dispersion can be classified as "directly visible from the camera", direct illumination and ambient occlusion are not. And dithering helps with those too.
Image Click here. You'll thank me later.

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

Re: Implementation for Blue-noise Dithered Sampling

Postby toxie » Thu Feb 02, 2017 4:23 pm

True, unless one uses a distribution over the screen instead of per-pixel for example (and then merges the two schemes). So maybe i was a bit distracted here by my "own" usecases and experiments, sorry. ;) And then you sacrifice that part in addition to potential quality loss for these "directly visible" dimensions (as one optimizes the sample set offsets for a larger set of dimensions, where-as the lower ones are (most likely?) the more important).

Which brings me to a simple idea: What about weighting the dimensions/bounces in the optimization process? So that early dimensions are more important than later ones? So using kind of a custom vector length that favors lower dimensions over larger ones?

But maybe that's not even true. Thinking more about it, it could also be that the lower dimensions are only important in the beginning/low sample count, but the higher dimensions become more important for growing sample counts? All very scene dependent of course.

EDIT: as for the example: Yes, that's why i wrote dimensions/bounces, so basically everything > first hit incl. collecting the stuff (direct light, pre-computed data or something like AO) in there.
Better you leave here with your head still full of kitty cats and puppy dogs.

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

Re: Implementation for Blue-noise Dithered Sampling

Postby jbikker » Wed Feb 08, 2017 12:41 pm

OK, did some quick tests:

- Applying the method to direct light sampling yields the results presented in the paper.
- Applying the method to the first diffuse bounce yields no perceivable improvement in quality.

In general, the number of dimensions is a problem: I tried 6 dimensions (sampling direct light on first diffuse surface, then the first diffuse bounce and finally direct light on the second diffuse surface) but this already seems to decrease the quality of the penumbras compared to using just 4 dimensions. This would suggest that just using 2 dimensions could yield the best quality; this way additional dimensions do not affect the quality of the distribution of the first two. It could be that slightly more converged tiles yield better results; I had 128x128 / d=10 tiles of high quality and produced 32x32 / d=6 in just a few minutes (didn't expect to need them).

So that's pretty much what everyone expected.

That being said, the method obviously improves image quality for the first couple of samples, it's straight-forward to implement and should have only a tiny impact on performance.

- Jacco.

EDIT: slightly more converged tile. Method applied to 6 dimensions (NEE-1, diff bounce, NEE-2). Obvious tiling pattern due to small tiles; this disappears for larger tiles.

Image

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

Re: Implementation for Blue-noise Dithered Sampling

Postby toxie » Thu Feb 09, 2017 10:51 am

What do you compare it against in that picture?

EDIT: maybe also due to the semi-magical weighting function, smaller tiles are better? if thats the case then one could also have different small tiles that are then used "randomly" over the screen to get rid of the tiling patterns.
Better you leave here with your head still full of kitty cats and puppy dogs.


Return to “Tools, Demos & Sources”

Who is online

Users browsing this forum: No registered users and 1 guest