# PDF of BRDF respecting the spherical coordinates

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.

• 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/… Aug 30 at 20:34

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.