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

Function smith_g1

tools/bloom-reference/src/main.rs:1332–1336  ·  view source on GitHub ↗
(n_dot_x: f32, alpha: f32)

Source from the content-addressed store, hash-verified

1330}
1331
1332fn smith_g1(n_dot_x: f32, alpha: f32) -> f32 {
1333 let a2 = alpha * alpha;
1334 let inner = ((1.0 - a2) * n_dot_x * n_dot_x + a2).sqrt();
1335 2.0 * n_dot_x / (n_dot_x + inner + 1e-6)
1336}
1337
1338// ============================================================
1339// Environment (HDR equirectangular map + procedural fallback)

Callers 1

sample_brdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected