MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / d_ggx

Function d_ggx

tools/bloom-reference/src/main.rs:1077–1082  ·  view source on GitHub ↗

GGX (Trowbridge-Reitz) normal distribution.

(n_dot_h: f32, alpha: f32)

Source from the content-addressed store, hash-verified

1075
1076/// GGX (Trowbridge-Reitz) normal distribution.
1077fn 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

Callers 1

evaluate_brdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected