Page 1 of 1

Poisson Disc Sampling

Posted: Sat Oct 15, 2022 8:24 pm
by SelfDotX
Poisson disc sampling, an algorithm for generating tightly-packed points which are all some minimum distance from one another.

Based on: this video - the first few minutes are also a good description.

A visualization of the selection process with some color added based on the 'age' the point was picked.
Poisson.png
Poisson.png (846.83 KiB) Viewed 4434 times
and the actual points table displayed as... points
Poisson2.png
Poisson2.png (27.56 KiB) Viewed 4434 times

Re: Poisson Disc Sampling

Posted: Sun Oct 16, 2022 8:12 am
by ReFreezed
This is pretty useful stuff!

Re: Poisson Disc Sampling

Posted: Sun Oct 16, 2022 1:26 pm
by SelfDotX
Thanks! It started out as a simple starfield generator, but the more 'knobs' I add and 'dials' I turn, I'm seeing a lot of possibilities here. Since I really need to get around to learning shaders, I think the first project will be something that takes in the points and outputs 'nebula' type shading based on point density/age.

Re: Poisson Disc Sampling

Posted: Tue Oct 18, 2022 10:36 am
by darkfrei
I like this explanation:

https://youtu.be/flQgnCUxHlw


Re: Poisson Disc Sampling

Posted: Wed Oct 19, 2022 8:57 am
by darkfrei
My implementation (move mouse to create new circles)
press space to switch the view
press S to reset the field
press G to hide he grid
:awesome:
poisson-disc-sampling-02.png
poisson-disc-sampling-02.png (116.91 KiB) Viewed 4253 times
https://github.com/darkfrei/love2d-lua- ... c-sampling

https://www.youtube.com/watch?v=PlQuPHga82Q

Re: Poisson Disc Sampling

Posted: Wed Oct 19, 2022 11:57 am
by darkfrei
Situation, if the Poisson Disc Sampling allows just one connection to the old points.
poisson-disc-sampling-03.png
poisson-disc-sampling-03.png (16.78 KiB) Viewed 4236 times
https://youtu.be/cqcDK5IPvhM



https://github.com/darkfrei/love2d-lua- ... c-sampling

Re: Poisson Disc Sampling

Posted: Wed Oct 19, 2022 1:34 pm
by ReFreezed
@darkfrei
Your implementation doesn't look quite as random and evenly distributed as the original. I see more patterns and lines among the samples.

Re: Poisson Disc Sampling

Posted: Wed Oct 19, 2022 3:11 pm
by darkfrei
ReFreezed wrote: Wed Oct 19, 2022 1:34 pm @darkfrei
Your implementation doesn't look quite as random and evenly distributed as the original. I see more patterns and lines among the samples.
You are right, it's not the same: in the original PDS the generated point will be chosen randomly, but here the generated point will be chosen near the mouse position is only.
But you can simulate the original simulation if you move mouse from starting point to the outside.

Points:
2022-10-19T17_02_35-poisson-disc-sampling-04.png
2022-10-19T17_02_35-poisson-disc-sampling-04.png (57.79 KiB) Viewed 4209 times
Connections:
2022-10-19T17_02_50-poisson-disc-sampling-04.png
2022-10-19T17_02_50-poisson-disc-sampling-04.png (679.13 KiB) Viewed 4209 times
https://youtu.be/SdPaPliAi7s