GGX (Trowbridge-Reitz) normal distribution.
(n_dot_h: f32, alpha: f32)
| 1075 | |
| 1076 | /// GGX (Trowbridge-Reitz) normal distribution. |
| 1077 | fn d_ggx(n_dot_h: f32, alpha: f32) -> f32 { |
| 1078 | let a2 = alpha * alpha; |
| 1079 | let nh2 = n_dot_h * n_dot_h; |
| 1080 | let denom = nh2 * (a2 - 1.0) + 1.0; |
| 1081 | a2 / (std::f32::consts::PI * denom * denom) |
| 1082 | } |
| 1083 | |
| 1084 | /// Smith visibility term for GGX with height-correlated formulation. |
| 1085 | /// Closer to the ground truth than the separable G1*G2, and only |