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

Function v_smith

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

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)

Source from the content-addressed store, hash-verified

1085/// Closer to the ground truth than the separable G1*G2, and only
1086/// marginally more expensive.
1087fn 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.

Callers 2

sample_brdfFunction · 0.85
evaluate_brdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected