Phase 6 updates

Phase 6 · Slice 64 ·

Ambient occlusion (URP’s SSAO feature)

  • The renderer data's active ScreenSpaceAmbientOcclusion feature sends each camera its settings (CameraSetAmbientOcclusion, API 58: intensity, radius, falloff distance, sample count from Samples or the older SampleCount, downsampling).
  • The renderer (crates/render/src/ao.rs) runs it per view once the opaque geometry is drawn (GPU culling's second phase included), before the transparent: occlusion from the depth buffer alone (view positions from the inverse projection, normals from the nearer neighbour on each axis, a per-pixel rotated spiral of hemisphere samples with a range check, a bias growing with distance, faded out toward the falloff distance) into a half-float texture, then a 5x5 depth-aware blur multiplied into the view's color. Render textures' cameras and reflection captures go without.
  • It darkens the opaque image as a whole, as URP's After Opaque option does: Direct Lighting Strength, the blue noise method, normals from a normals pass and the blur quality options aren't followed yet.
  • Checked by ambient_occlusion_darkens_creases_after_the_opaque_geometry; BossIsComing's office (its PC renderer has the feature) darkens at contact edges.
  • Next: decide with the corpus (noise and gradient Shader Graph nodes, older Shader Graphs, the Sprite target).