# Poisson Disk Algorithm Parameters

This topic is 2635 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

I'm working on my CPU ray tracer. It will use Poisson Disk samples for subpixel sampling. I have successfully implemented the simple algorithm described here.

The algorithm functions by choosing a new point on the plane a certain distance from the previous point, checking if it's valid, and, if so, inserting it into a list. The algorithm tests multiple potential points.

Because an exact number of samples per pixel is required, this algorithm is, on the face of it, not suitable. However, by sorting the points by lowest coordinate, you can discard extra points. Obviously, throwing away lots of points is bad.

The question is, given a Poisson Disk distribution, how many points in a given area can I expect for a given minimum distance? Are there any specifics to this algorithm in particular?

Thanks,
-G

##### Share on other sites
You should precompute many sampling patterns with the right Poisson distribution and the desired number of samples and pick one of them at random for each pixel (with a random reflection and maybe a random rotation for added variety); generating a new sampling pattern for every pixel and throwing it away after one use is very wasteful.

##### Share on other sites
[color="#1C2837"]You should precompute many sampling patterns with the right Poisson distribution and the desired number of samples and pick one of them at random for each pixel (with a random reflection and maybe a random rotation for added variety); generating a new sampling pattern for every pixel and throwing it away after one use is very wasteful.[/quote]Yes, that is what I do. In practice, I find that just one Poisson distribution for all subpixel samples is sufficient. For depth of field, I got aliasing, so I precompute 50 distributions.

[color="#1c2837"]Anyway, since there didn't appear to be an analytic solution, I made some decent heuristics. I found that (for square domains), the radius to be used in a triangular grid is [color="#1C2837"]2[sup]0.5[/sup]3[sup]-0.25[/sup]num_points[sup]-0.5[/sup]. In practice, however, the Poisson Disk is not a perfectly efficient packing. My hackish solution is to replace the sqare root (num_points[sup]-0.5[/sup]) by (1.25*num_points[sup]0.51[/sup])[sup]-1[/sup], which works with a minimum of oversampling for sample counts 1-30,000.

[color="#1C2837"]Ian

1. 1
2. 2
Rutin
19
3. 3
4. 4
khawk
15
5. 5
A4L
13

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633743
• Total Posts
3013644
×