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.
1#define_import_path bevy_pbr::ssao_utils
3#import bevy_render::maths::{PI, HALF_PI}
5// Approximates single-bounce ambient occlusion to multi-bounce ambient occlusion
6// https://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pdf#page=78
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);
Contents