Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit15ce14a4c1

README.md

ao_walk

The screen-space walk of ambient occlusion over a visibility bitmask, shared by the estimate of occlusion alone (ao_pass) and the estimate that also gathers the light the occluders send (ao_pass_indirect). It includes ao_common.

The walk marks, along each slice, the sectors of the hemisphere every depth tap closes, integrates the open ones against the cosine lobe for the visible share, and takes their mean direction as the bent normal. Each sector run a tap closes first is handed to the kernel with the tap's pixel, the occluder's front face and that run's share of the lobe.

A kernel including it states three functions and calls ao_walk(gid):

#include "@builtin::systems.ambientOcclusion.ao_walk"

fn ao_on_closed(tap: vec2<i32>, front: vec3<f32>, s: AoSurface, weight: f32) { ... }
fn ao_emit(px: vec2<u32>, visibility: f32, bent: vec3<f32>, s: AoSurface, cfg: AoConfig) { ... }
fn ao_emit_none(px: vec2<u32>, cfg: AoConfig) { ... }

@compute @workgroup_size(8, 8)
fn main(@builtin(global_invocation_id) gid: vec3<u32>) { ao_walk(gid); }