How to properly clamp beckmann distribution
Asked Answered
C

1

5

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: https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf

enter image description here

Where M is a microfacet normal, N is the macrofacet normal and ab is a "hardness" parameter between [0, 1].

My issue is that this distribution often returns obscenely large values, especially when ab is very small.

For instance, the Beckmann distribution is used to calculate the probability of generating a microfacet normal M per this equation :

enter image description here

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?

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.

Cosby answered 20/4, 2014 at 2:46 Comment(0)
M
6

I was having the same question you did.

If you read

http://blog.selfshadow.com/publications/s2012-shading-course/hoffman/s2012_pbs_physics_math_notes.pdf

and

http://blog.selfshadow.com/publications/s2012-shading-course/hoffman/s2012_pbs_physics_math_notebook.pdf

You'll notice it's perfectly normal. To quote from the links:

"The Beckmann Αb parameter is equal to the RMS (root mean square) microfacet slope. Therefore its valid range is from 0 (non-inclusive –0 corresponds to a perfect mirror or Dirac delta and causes divide by 0 errors in the Beckmann formulation) and up to arbitrarily high values. There is no special significance to a value of 1 –this just means that the RMS slope is 1/1 or 45°.(...)"

Also another quote:

"The statistical distribution of microfacet orientations is defined via the microfacet normal distribution function D(m). Unlike F (), the value of D() is not restricted to lie between 0 and 1—although values must be non-negative, they can be arbitrarily large (indicating a very high concentration of microfacets with normals pointing in a particular direction). (...)"

You should google for Self Shadow's Physically Based Shading courses which is full of useful material (there is one blog post for each year: 2010, 2011, 2012 & 2013)

Maddox answered 22/4, 2014 at 23:29 Comment(1)
Thanks! I'll definitely take a look at those resources.Cosby

© 2022 - 2024 — McMap. All rights reserved.