Inheritance: Pass →
A pass for a basic SSAO effect.
SAOPass and GTAPass produce a more advanced AO but are also more expensive.
const ssaoPass = new SSAOPass( scene, camera, width, height );
composer.addPass( ssaoPass );
SSAOPass is an addon, and must be imported explicitly, see Installation#Addons.
import { SSAOPass } from 'three/addons/postprocessing/SSAOPass.js';
Constructs a new SSAO pass.
scene
The scene to compute the AO for.
camera
The camera.
width
The width of the effect.
Default is 512.
height
The height of the effect.
Default is 512.
kernelSize
The kernel size.
Default is 32.
The camera.
Overwritten to perform a clear operation by default.
Default is true.
Overrides: Pass#clear
The height of the effect.
Default is 512.
The kernel radius controls how wide the AO spreads.
Default is 8.
Defines the maximum distance that should be affected by the AO.
Default is 0.1.
Defines the minimum distance that should be affected by the AO.
Default is 0.005.
Overwritten to disable the swap.
Default is false.
Overrides: Pass#needsSwap
The output configuration.
Default is 0.
The scene to render the AO for.
The width of the effect.
Default is 512.
Frees the GPU-related resources allocated by this instance. Call this method whenever the pass is no longer used in your app.
Overrides: Pass#dispose
Performs the SSAO pass.
renderer
The renderer.
writeBuffer
The write buffer. This buffer is intended as the rendering destination for the pass.
readBuffer
The read buffer. The pass can access the result from the previous pass from this buffer.
deltaTime
The delta time in seconds.
maskActive
Whether masking is active or not.
Overrides: Pass#render
Sets the size of the pass.
width
The width to set.
height
The height to set.
Overrides: Pass#setSize