0
$\begingroup$

I'm reading the article Sampling microfacet BRDF.

The GGX function is $D(h)$, the articles says the PDF respecting the spherical coordinates is $P_1(\theta)=D(h)Cos(\theta)Sin(\theta)$. But I think the PDF(in spherical coordinates) is $P_2(\theta)=D(h)Cos(\theta)$, where the term $Sin(\theta)$ is the Jacobian of integrator. Note that $\theta$ is the angle between normal vector and half vector.

Another intuitive feeling is that $P_1(0)=0$, $P_2(0)=D(h)$. I think $P_2$ seems more reasonable.

Is my understanding correct? Thanks.

$\endgroup$
1
  • $\begingroup$ Yes the $\sin\theta$ is from the Jacobian when going from Cartesian to spherical coordinates. But that also means that it is indeed correct to have the sine in $P_1$. On the other hand $P_2$ seems to be wrt the solid angle measure, where $d\omega = \sin\theta \,d\theta\,d\phi$. Note that this is consistent with the definition of probability density wrt some measure: en.m.wikipedia.org/wiki/… $\endgroup$ Commented Aug 30, 2021 at 20:34

1 Answer 1

3
$\begingroup$

The pdf with respect to solid angle (area on the sphere) is $D(h) \cos \theta \, \mathrm{d}\omega$, but then when you go to sample it in terms of spherical coordinates, you must include the $\sin \theta$ factor. $$ \mathrm{d}\omega = \sin \theta \, \mathrm{d}\theta \, \mathrm{d}\phi $$ If you imagine choosing sample points uniformly in $(\theta, \phi)$ space, then they would concentrate at the pole, and so you would need to weight down by $\sin \theta$ to compensate for that and get points that are uniform in area on the sphere.

For importance-sampling the NDF, with an isotropic NDF like this the $\phi$ parameter is just chosen uniformly from $[0, 2\pi]$, and then the remaining $P(\theta)$ does need to include the $\sin \theta$ factor, otherwise you would have too many points close to the pole. It is true that $P(0) = 0$; that is correct because a $\mathrm{d}\phi$-wide sliver comes to have zero width at the pole, and so the density in $(\theta, \phi)$ space has to come to zero there.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.