Import
GTAOPass is an addon, and must be imported explicitly, see Installation#Addons.
import { GTAOPass } from 'three/addons/postprocessing/GTAOPass.js';
Constructor
new GTAOPass( scene : Scene, camera : Camera, width : number, height : number, parameters : Object, aoParameters : Object, pdParameters : Object )
Constructs a new GTAO pass.
| scene |
The scene to compute the AO for. |
| camera |
The camera. |
| width |
The width of the effect. Default is |
| height |
The height of the effect. Default is |
| parameters |
The pass parameters. |
| aoParameters |
The AO parameters. |
| pdParameters |
The denoise parameters. |
Properties
.blendIntensity : number
The AO blend intensity.
Default is 1.
.clear : boolean
Overwritten to perform a clear operation by default.
Default is true.
- Overrides: Pass#clear
.height : number
The height of the effect.
Default is 512.
.output : number
The output configuration.
Default is 0.
.pdRadiusExponent : number
The Poisson Denoise radius exponent.
Default is 2.
.pdRings : number
The number of Poisson Denoise rings.
Default is 2.
.pdSamples : number
The Poisson Denoise sample count.
Default is 16.
.width : number
The width of the effect.
Default is 512.
Methods
.dispose()
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
.render( renderer : WebGLRenderer, writeBuffer : WebGLRenderTarget, readBuffer : WebGLRenderTarget, deltaTime : number, maskActive : boolean )
Performs the GTAO 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
.setGBuffer( depthTexture : DepthTexture, normalTexture : Texture )
Configures the GBuffer of this pass. If no arguments are passed, the pass creates an internal render target for holding depth and normal data. External depth and normal data must use separate textures and remain owned by the caller. If no normal texture is supplied, normals are reconstructed from depth for AO and denoising, and the normal output displays black.
| depthTexture |
The depth texture. |
| normalTexture |
The normal texture. |
.setSceneClipBox( box : Box3 )
Configures the clip box of the GTAO shader with the given AABB.
| box |
The AABB enclosing the scene that should receive AO. When passing
|
.setSize( width : number, height : number )
Sets the size of the pass.
| width |
The width to set. |
| height |
The height to set. |
- Overrides: Pass#setSize
.updateGtaoMaterial( parameters : Object )
Updates the GTAO material from the given parameter object.
| parameters |
The GTAO material parameters. |
.updatePdMaterial( parameters : Object )
Updates the Denoise material from the given parameter object.
| parameters |
The denoise parameters. |