Capítulo 273 de 859
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 );
Constructor
| Signature |
|---|
new SSAOPass( scene : Scene, camera : Camera, width : number, height : number, kernelSize : number ) |
Properties
| Property | Description |
|---|---|
.camera : Camera | The camera. |
.clear : boolean | Overwritten to perform a clear operation by default. |
.height : number | The height of the effect. |
.kernelRadius : number | The kernel radius controls how wide the AO spreads. |
.maxDistance : number | Defines the maximum distance that should be affected by the AO. |
.minDistance : number | Defines the minimum distance that should be affected by the AO. |
.needsSwap : boolean | Overwritten to disable the swap. |
.output : number | The output configuration. |
.scene : Scene | The scene to render the AO for. |
.width : number | The width of the effect. |
Methods
| Method | Description |
|---|---|
.dispose() | Frees the GPU-related resources allocated by this instance. Call this method whenever the pass is no longer used in your app. |
.render( renderer : WebGLRenderer, writeBuffer : WebGLRenderTarget, readBuffer : WebGLRenderTarget, deltaTime : number, maskActive : boolean ) | Performs the SSAO pass. |
.setSize( width : number, height : number ) | Sets the size of the pass. |