N8AO

A fast, high quality ambient occlusion effect, wrapping N8python/n8ao. Self-contained - unlike SSAO, it does not need enableNormalPass on <EffectComposer>.

import { N8AO } from '@react-three/postprocessing'

return (
  <N8AO
    aoRadius={5} // ambient occlusion sampling radius
    distanceFalloff={1} // distance falloff
    intensity={1} // effect intensity
    quality="performance" // 'performance' | 'low' | 'medium' | 'high' | 'ultra'
    aoSamples={16} // amount of ambient occlusion samples per frame
    denoiseSamples={4} // amount of denoise samples per frame
    denoiseRadius={12} // denoise sampling radius
    color={undefined} // tints the occlusion, defaults to black
    halfRes={false} // renders the effect at half resolution
    depthAwareUpsampling={true} // enables or disables depth-aware upsampling
    screenSpaceRadius={false} // scales the sampling radius with distance from the camera
    renderMode={0} // 0: Combined, 1: AO only, 2: No AO, 3: Split, 4: Split AO
  />
)

Props

NameTypeDefaultDescription
aoRadiusNumber5The ambient occlusion sampling radius.
distanceFalloffNumber1The distance falloff.
intensityNumber1The effect intensity.
quality'performance' | 'low' | 'medium' | 'high' | 'ultra''performance'The quality preset.
aoSamplesNumber16The amount of ambient occlusion samples per frame.
denoiseSamplesNumber4The amount of denoise samples per frame.
denoiseRadiusNumber12The denoise sampling radius.
colorColorundefinedTints the occlusion. Defaults to black.
halfResBooleanfalseRenders the effect at half resolution.
depthAwareUpsamplingBooleantrueEnables or disables depth-aware upsampling.
screenSpaceRadiusBooleanfalseScales the sampling radius with distance from the camera.
renderMode0 | 1 | 2 | 3 | 400: Combined, 1: AO only, 2: No AO, 3: Split, 4: Split AO.