fn fixed_directional_lighting(face: Face) -> f32 {
    let normal = face.normal_vector();
    const LIGHT_1_DIRECTION: Vector3<f32> = Vector3::new(0.4, -0.1, 0.0);
    const LIGHT_2_DIRECTION: Vector3<f32> = Vector3::new(-0.4, 0.35, 0.25);
    (1.0 - 1.0 / 16.0)
        + 0.25 * (LIGHT_1_DIRECTION.dot(normal).max(0.0) + LIGHT_2_DIRECTION.dot(normal).max(0.0))
}
/// Simple directional lighting used to give corners extra definition.
/// Note that this algorithm is also implemented in the fragment shader for GPU rendering.
Simple directional lighting used to give corners extra definition.
Note that this algorithm is also implemented in the fragment shader for GPU rendering.
Simple directional lighting used to give corners extra definition . Note that this algorithm is also implemented in the fragment shader for GPU rendering .
fn fixed_directional_lighting(face: Face) -> f32 {
    let normal = face.normal_vector();
    const LIGHT_1_DIRECTION: Vector3<f32> = Vector3::new(0.4, -0.1, 0.0);
    const LIGHT_2_DIRECTION: Vector3<f32> = Vector3::new(-0.4, 0.35, 0.25);
    (1.0 - 1.0 / 16.0)
        + 0.25 * (LIGHT_1_DIRECTION.dot(normal).max(0.0) + LIGHT_2_DIRECTION.dot(normal).max(0.0))
}
fn fixed_directional_lighting ( face : Face ) -> f32 { let normal = face . normal_vector ( ) ; const LIGHT_1_DIRECTION : Vector3 < f32 > = Vector3 :: new ( 0.4 , - 0.1 , 0.0 ) ; const LIGHT_2_DIRECTION : Vector3 < f32 > = Vector3 :: new ( - 0.4 , 0.35 , 0.25 ) ; ( 1.0 - 1.0 / 16.0 ) + 0.25 * ( LIGHT_1_DIRECTION . dot ( normal ) . max ( 0.0 ) + LIGHT_2_DIRECTION . dot ( normal ) . max ( 0.0 ) ) }
Simple directional lighting used to give corners extra definition.
Simple directional lighting used to give corners extra definition .
face
Face