Smith visibility term for GGX with height-correlated formulation. Closer to the ground truth than the separable G1*G2, and only marginally more expensive.
(n_dot_v: f32, n_dot_l: f32, alpha: f32)
| 1085 | /// Closer to the ground truth than the separable G1*G2, and only |
| 1086 | /// marginally more expensive. |
| 1087 | fn v_smith(n_dot_v: f32, n_dot_l: f32, alpha: f32) -> f32 { |
| 1088 | let a2 = alpha * alpha; |
| 1089 | let ggx_v = n_dot_l * ((n_dot_v * (1.0 - a2) + a2) * n_dot_v).sqrt(); |
| 1090 | let ggx_l = n_dot_v * ((n_dot_l * (1.0 - a2) + a2) * n_dot_l).sqrt(); |
| 1091 | 0.5 / (ggx_v + ggx_l + 1e-6) |
| 1092 | } |
| 1093 | |
| 1094 | /// Burley (Disney) diffuse term. Tracks the view-dependent darkening |
| 1095 | /// near grazing angles for rough dielectrics that Lambert gets wrong. |
no outgoing calls
no test coverage detected