Skip to Content
DocumentationURP ModulesCavity

Cavity

Cavity is a screen-space pass that darkens crevices and lightens convex ridges by analyzing depth and normal curvature. Think of it as SSAO with an art-direction knob: lean it toward classic AO, toward a Blender-style cavity highlight, or anywhere between. It composites cleanly under Genesis cel shading and works on meshes without baked AO. Cavity is an optional module added through the Renderer Feature Installer.

Video

A sculpted stone prop rotating with the Cavity pass toggling on and off, crevices darkening and convex ridges brightening to reveal carved surface detail that flat lighting alone misses.

modules/cavity/cavity-toggle.mp4

Screen-space crevice darkening and ridge highlighting on a sculpted prop.

When to use it

  • Sculpted props without baked AO maps.
  • Procedural geometry that cannot be baked offline.
  • Stylized scenes that need a comic-book inked-crevice look.
  • Polish pass on top of baked AO for extra contact darkening.

Stone surface reads flat — crevices and chips lack contrast.

Crevices darken, ridges brighten, surface reads as carved stone.

No cavity
Cavity on

Cavity adds local contrast that flat lighting alone cannot.

How it works

Cavity samples the Depth Texture and normal buffer in a screen-space disk around each pixel. Concave neighborhoods (where samples sit above the tangent plane) darken; convex neighborhoods (samples below) brighten. A Gaussian falloff weights closer samples more heavily, and the result is bilaterally blurred and composited multiplicatively under the lit color. On the deferred path it reuses the GBuffer normals when available.

Renderer Feature setup

  1. Open Window → Genesis → Renderer Feature Installer and enable Cavity.
  2. Add the Genesis Cavity override to your global Volume.
  3. Pick a preset: Subtle, Sculpted, or Inked.
  4. Tune Crevice Color and Ridge Color to match your art direction.

Settings

Inspector labelShader propertyTypeDefaultDescription
Radius_CavityRadiusFloat0.4World-space sampling radius. Smaller targets tighter crevices.
Crevice Intensity_CreviceIntensityFloat (0–2)1.0Strength of concave darkening.
Ridge Intensity_RidgeIntensityFloat (0–2)0.5Strength of convex highlighting. Set 0 for AO-only behavior.
Crevice Color_CreviceColorColorRGB(0.05, 0.04, 0.06)Tint multiplied into crevices.
Ridge Color_RidgeColorColorRGB(1.10, 1.08, 1.04)Tint added to ridges.
Samples_SamplesInt (4–32)12Disk samples per pixel. 8 for mobile, 16+ for cinematic.
Blur Passes_BlurPassesInt (0–3)1Bilateral blur iterations. 0 = sharp, 2 = silky.

Performance & quality

  • A half-resolution mode is available for mobile and halves the pass cost.
  • The bilateral blur uses the Depth Texture as guidance, so it does not leak across silhouettes.
  • Cavity is RenderGraph-native on Unity 6.

Cavity is not a replacement for baked AO on hero assets — it cannot see contact between two separate meshes the way an offline baker can. Layer them.

Tips & gotchas

  • If crevices look splotchy, lower the sample count and add a blur pass instead.
  • Set Ridge Intensity = 0 for pure SSAO behavior.
  • Combine with Detail Textures to amplify surface micro-detail.
Last updated on