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

Function burley_diffuse

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

Burley (Disney) diffuse term. Tracks the view-dependent darkening near grazing angles for rough dielectrics that Lambert gets wrong.

(n_dot_l: f32, n_dot_v: f32, l_dot_h: f32, roughness: f32)

Source from the content-addressed store, hash-verified

1094/// Burley (Disney) diffuse term. Tracks the view-dependent darkening
1095/// near grazing angles for rough dielectrics that Lambert gets wrong.
1096fn burley_diffuse(n_dot_l: f32, n_dot_v: f32, l_dot_h: f32, roughness: f32) -> f32 {
1097 let fd90 = 0.5 + 2.0 * l_dot_h * l_dot_h * roughness;
1098 let light = 1.0 + (fd90 - 1.0) * (1.0 - n_dot_l).powi(5);
1099 let view = 1.0 + (fd90 - 1.0) * (1.0 - n_dot_v).powi(5);
1100 light * view / std::f32::consts::PI
1101}
1102
1103#[derive(Clone, Copy)]
1104struct SurfaceSample {

Callers 2

sample_brdfFunction · 0.85
evaluate_brdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected