SSAO
A Screen Space Ambient Occlusion (SSAO) effect. For high quality visuals use two SSAO effect instances in a row with different radii, one for rough AO and one for fine details.
This effect supports depth-aware upsampling and should be rendered at a lower resolution. The resolution should match that of the downsampled normals and depth. If you intend to render SSAO at full resolution, do not provide a downsampled normalDepthBuffer and make sure to disable depthAwareUpsampling.
import { SSAO } from '@react-three/postprocessing'
import { BlendFunction } from 'postprocessing'
return (
<SSAO
blendFunction={BlendFunction.MULTIPLY} // blend mode
samples={30} // amount of samples per pixel (shouldn't be a multiple of the ring count)
rings={4} // amount of rings in the occlusion sampling pattern
distanceThreshold={1.0} // global distance threshold at which the occlusion effect starts to fade out. min: 0, max: 1
distanceFalloff={0.0} // distance falloff. min: 0, max: 1
rangeThreshold={0.5} // local occlusion range threshold at which the occlusion starts to fade out. min: 0, max: 1
rangeFalloff={0.1} // occlusion range falloff. min: 0, max: 1
luminanceInfluence={0.9} // how much the luminance of the scene influences the ambient occlusion
radius={20} // occlusion sampling radius
intensity={1.0} // intensity of the ambient occlusion
bias={0.5} // occlusion bias
/>
)