Skip to main content

SELF_SHADOW_GLSL

Constant SELF_SHADOW_GLSL 

Source
pub const SELF_SHADOW_GLSL: &str = r#"
float compute_self_shadow(vec3 normal, vec3 light_dir, float bias) {
    float n_dot_l = dot(normal, normalize(light_dir));
    return clamp((n_dot_l + bias) / (bias * 2.0 + 0.01), 0.0, 1.0);
}
"#;
Expand description

Self-shadow computation in GLSL.