Spherical Sampling of Projected Disk

187 Views Asked by At

Given a 2D solid disk centered at some 3D point $\vec{x}$ with radius $r$ and normal $\vec{N}$, I need to compute a random unit vector from the origin that hits the disk. The vector needs to be uniformly random with respect to solid angle, and I also need the associated PDF.

I tried to get the area of the disk projected onto a unit sphere at the origin (the reciprocal of which is the PDF), but the integral is tricky, and in any case I still don't know how to do the sampling.

I am currently sampling the projection of the disk's bounding sphere, which is much easier. However, this approach is inefficient.

How can this sampling be done, and what is the PDF?