# Microfacet model - BRDF obtain extreme values at grazing angles

I've been trying to replicate the result of this paper (linked directly to PDF paper, but you don't need to read it to give an answer) and encountered a problem with the BRDF according to the following well-known formula: where F,G,D are Fresnel reflection, Shadow masking, and microfacet distribution respectively. The trouble I encounter is in the denominator, where i is the incident ray, n is the surface normal, and o is the angle of view.

Just by looking at the formula, probably you can already guess what happen when the ray comes from grazing angle: |in| approach zero, and if I look at it also at grazing angle then |on| would also approach zero. And as much as I hoped that FGD would approach zero faster than the denominator, it doesn't. (I used GGX distribution, but the same thing happen to Beckmann or Phong) The resulting BRDF I calculated is something completely different from not only the paper that I'm trying to replicate, but also from most other BRDF. (strong peak at grazing angle, I did it for refraction case but it's the same for reflection) (result from the paper, most brdf have this shape)

I double checked D,F and G so it can't be any of those, but then what went wrong? Has anyone tried this BRDF model and encountered a similar problem?

• The G factor specifically is (or should be) taking care of this - the whole factor G / ((i . n)(o . n)) should go to zero at grazing angles. Can you post the G you're using? – Nathan Reed Jul 26 '13 at 17:13
• Thanks Nathan, I also noticed that the peak values from my data is different from the paper, which means one of the coefficient is wrong, but still I couldn't find out where the problem is. The G factor I implemented in Matlab is the one derived for GGX distribution taken from the paper: G=2*Chi/(1+sqrt(1+(alphaG^2)*(tan(ThetaI))^2)); i.imgur.com/rBiDt2y.png I've plotted the function and G/((i.n)(o.n)) for fixed o at 85 degree (for m.n > 0, Chi=1). The paper could also be wrong but it's hardly the case as it's quite popular and many people used GGX distribution already. – Nhan Nguyen Jul 29 '13 at 9:07
• Perhaps the graphs in the paper incorporate the N.L factor that multiplies the BRDF in the radiometric integral? That is not technically part of the BRDF but it's necessary to keep things from blowing up at the grazing angles. – Nathan Reed Oct 9 '13 at 17:10