title: Microfacets Theory: A CDF for normal distribution given incident direction
body: <p>The paper <a href="http://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf" rel="nofollow">Microfacet Models for Refraction through Rough Surfaces</a>, page 3 section 3.1, describes the NDF. <br/>The problem: Given incident ray <code>v</code> I'd like to generate a CDF <code>F</code> that given an angle <code>θ</code> gives the probability that normals are distributed at or less than θ from <code>v</code>, i.e. <code>dot(v,m)&lt;=cos(θ)</code> w.p. <code>F(θ)</code>.</p>
  
  <p>For <code>v = n</code> where <code>n</code> is the macrosurface normal this is simple (Assuming isotropic NDF): </p>
  
  <p><img src="https://chart.googleapis.com/chart?cht=tx&amp;chl=F(%5Ctheta)%20%3D%20%5Cint_0%5E%7B%5Ctheta%7D%5Cint_0%5E%7B2%5Cpi%7DD(%5Ctheta)sin%5Ctheta%20cos%5Ctheta%20d%5Ctheta%20d%5Cphi%20%3D%20%5Cint_0%5E%7B%5Ctheta%7D2%5Cpi%20D(%5Ctheta)sin%5Ctheta%20cos%5Ctheta%20d%5Ctheta" alt="formula1"></p>
  
  <p>Which is very easy to compute for the common GGX or Beckmann NDFs.</p>
  
  <p>The paper gives the formula <img src="https://chart.googleapis.com/chart?cht=tx&amp;chl=%5Cint%20D(m)%5Cfrac%7Bv%5Ccdot%20m%7D%7Bv%5Ccdot%20n%7Dd%5Comega_m%20%3D%201" alt="formula2"> but it is harder to integrate and still not useful. </p>
  
  <p>Any help would be appreciated.</p>