Jump to content
  • Advertisement
Sign in to follow this  
Geometrian

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!