title: How to properly clamp beckmann distribution
body: <p>I am trying to implement a Microfacet BRDF shading model (similar to the Cook-Torrance model) and I am having some trouble with the Beckmann Distribution defined in this paper: <a href="https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf" rel="nofollow noreferrer">https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf</a></p>
  
  <p><img src="https://i.stack.imgur.com/6phOX.png" alt="enter image description here"></p>
  
  <p>Where M is a microfacet normal, N is the macrofacet normal and ab is a "hardness" parameter between [0, 1].</p>
  
  <p>My issue is that this distribution often returns obscenely large values, especially when ab is very small. </p>
  
  <p>For instance, the Beckmann distribution is used to calculate the probability of generating a microfacet normal M per this equation :</p>
  
  <p><img src="https://i.stack.imgur.com/QAQNU.png" alt="enter image description here"></p>
  
  <p>A probability has to be between the range [0,1], so how is it possible to get a value within this range using the function above if the Beckmann distribution gives me values that are 1000000000+ in size? </p>
  
  <p>So there a proper way to clamp the distribution? Or am I misunderstanding it or the probability function? I had tried simply clamping it to 1 if the value exceeded 1 but this didn't really give me the results I was looking for.</p>