Wednesday, January 3, 2018

physics - GGX specular BRDF is way over 1!


Now, the classic Torrance derivation for roughened surfaces which Cook took into vectorized form yields the familiar parametrization of a specular BRDF where we have the NDF which decides how much perturbation is around the average normal direction of the macrosurface. For example, in the isotropic GGX version, an alpha value is used to modulate just how rough the surface is or just how much specular reflection a partical halfdirection yields from the microsurface normal.


Then there's the geometry term which is, numerically, a protective term from the classic denominator of dot(n,v) * dot(n,l) which can tend to zero and the whole term to infinity. It also has a more physically intuitive side rendered irrelevant by the sheer horror of division by zero.



And there's the Fresnel term, the least threatening of all of them.


Basically, it's DGF / (4(n.v)(n.l)). And if any of these terms fail, it goes to hell. Hence, all of these terms have normalizing terms which force them in the [0,1] range. Unfortunately, the one I was studying from Epic does not converge give in to the normalization and some values at grazing angles get frustratingly high.


The BRDF is the ratio between the outgoing radiance and the incoming irradiance. Anything beyond 1 is weird to me. But 477.43 is... Well... I've double-checked everything, the math is a direct match. And yet...


Any ideas?



Answer



The BRDF is a reflectance density, not a reflectance. Values beyond 1.0 are perfectly sensible as long as they occur only in a small region of the parameter space. The whole thing has to integrate to a value in [0, 1] to avoid adding energy, but that doesn't imply it has to be in [0, 1] everywhere.


It's similar to a probability density. If you look at a standard pdf like the normal distribution and plug in a small value for sigma, you'll see the distribution gets narrow with a high peak that goes much higher than 1.0, even though probabilities can't be higher than 1.0. It can do that because it's not a probability, but a probability density, i.e. probability per unit length. When there is a lot of probability crammed into a small distance you get a high density.


The BRDF has units of reflectance per unit solid angle, so whenever there is a lot of reflectance in a narrow solid angle (e.g. with a shiny, high-gloss surface), you will get values greater than 1.0.


FWIW, I've calculated the integrated directional-hemispherical reflectance for GGX and various other common BRDFs and found they indeed do not add energy. (They sometimes absorb it even when they're not supposed to, but that's another story...)


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...