Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1import bevy_render::maths::{PI, HALF_PI};
3/// Approximates single-bounce ambient occlusion to multi-bounce ambient occlusion
4/// https://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pdf#page=78
5fn ssao_multibounce(visibility: f32, base_color: vec3<f32>) -> vec3<f32> {
6 let a = 2.0404 * base_color - 0.3324;
7 let b = -4.7951 * base_color + 0.6417;
8 let c = 2.7552 * base_color + 0.6903;
9 let x = vec3<f32>(visibility);
10 return max(x, ((x * a + b) * x + c) * x);
Contents