1#define_import_path bevy_pbr::ssao_utils 3#import bevy_render::maths::{PI, HALF_PI} 7fn ssao_multibounce(visibility: f32, base_color: vec3<f32>) -> vec3<f32> { 8 let a = 2.0404 * base_color - 0.3324; 9 let b = -4.7951 * base_color + 0.6417; 10 let c = 2.7552 * base_color + 0.6903; 11 let x = vec3<f32>(visibility); 12 return max(x, ((x * a + b) * x + c) * x); 15fn fast_sqrt(x: f32) -> f32 { 16 return bitcast<f32>(0x1fbd1df5 + (bitcast<i32>(x) >> 1u)); 19fn fast_acos(in_x: f32) -> f32 { 21 var res = -0.156583 * x + HALF_PI; 22 res *= fast_sqrt(1.0 - x); 23 return select(PI - res, res, in_x >= 0.0);