Skip to main content

RIM_LIGHT_GLSL

Constant RIM_LIGHT_GLSL 

Source
pub const RIM_LIGHT_GLSL: &str = r#"
uniform vec3 u_rim_color;
uniform float u_rim_power;
uniform float u_rim_intensity;

vec3 compute_rim(vec3 normal, vec3 view_dir) {
    float n_dot_v = max(dot(normalize(normal), normalize(view_dir)), 0.0);
    float rim = pow(1.0 - n_dot_v, u_rim_power);
    return u_rim_color * rim * u_rim_intensity;
}
"#;
Expand description

Fresnel rim light in GLSL.