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

Function fresnel_schlick

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

Schlick's Fresnel approximation. `f0` is reflectance at normal incidence; `cos_theta` is dot(surface_normal, view_dir).

(cos_theta: f32, f0: Vec3)

Source from the content-addressed store, hash-verified

1069/// Schlick's Fresnel approximation. `f0` is reflectance at normal
1070/// incidence; `cos_theta` is dot(surface_normal, view_dir).
1071fn fresnel_schlick(cos_theta: f32, f0: Vec3) -> Vec3 {
1072 let m = (1.0 - cos_theta).clamp(0.0, 1.0);
1073 f0 + (Vec3::ONE - f0) * (m * m * m * m * m)
1074}
1075
1076/// GGX (Trowbridge-Reitz) normal distribution.
1077fn d_ggx(n_dot_h: f32, alpha: f32) -> f32 {

Callers 2

sample_brdfFunction · 0.85
evaluate_brdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected