Capítulo 255 de 859

Chapter 255: GTAOPass

Core Idea

A pass for an GTAO effect.

GTAOPass provides better quality than SSAOPass but is also more expensive.

Key Concepts

  • blendIntensity : number: The AO blend intensity.
  • camera : Camera: The camera.
  • clear : boolean: Overwritten to perform a clear operation by default.
  • gtaoMap : Texture (readonly): A texture holding the computed AO.
  • height : number: The height of the effect.
  • output : number: The output configuration.
  • pdRadiusExponent : number: The Poisson Denoise radius exponent.
  • pdRings : number: The number of Poisson Denoise rings.
  • pdSamples : number: The Poisson Denoise sample count.
  • scene : Scene: The scene to render the AO for.

Code Examples

const gtaoPass = new GTAOPass( scene, camera, width, height );
gtaoPass.output = GTAOPass.OUTPUT.Denoise;
composer.addPass( gtaoPass );
  • What it demonstrates: Typical usage of GTAOPass.

Reference Tables

Constructor

Signature
new GTAOPass( scene : Scene, camera : Camera, width : number, height : number, parameters : Object, aoParameters : Object, pdParameters : Object )

Properties

PropertyDescription
.blendIntensity : numberThe AO blend intensity.
.camera : CameraThe camera.
.clear : booleanOverwritten to perform a clear operation by default.
.gtaoMap : Texture (readonly)A texture holding the computed AO.
.height : numberThe height of the effect.
.output : numberThe output configuration.
.pdRadiusExponent : numberThe Poisson Denoise radius exponent.
.pdRings : numberThe number of Poisson Denoise rings.
.pdSamples : numberThe Poisson Denoise sample count.
.scene : SceneThe scene to render the AO for.
.width : numberThe width of the effect.

Methods

MethodDescription
.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 GTAO pass.
.setGBuffer( depthTexture : DepthTexture, normalTexture : DepthTexture )Configures the GBuffer of this pass. If no arguments are passed, the pass creates an internal render target for holding depth and normal data.
.setSceneClipBox( box : Box3 )Configures the clip box of the GTAO shader with the given AABB.
.setSize( width : number, height : number )Sets the size of the pass.
.updateGtaoMaterial( parameters : Object )Updates the GTAO material from the given parameter object.
.updatePdMaterial( parameters : Object )Updates the Denoise material from the given parameter object.

Key Takeaways

  1. GTAOPass extends: Pass
  2. Most relevant properties: blendIntensity, camera, clear, gtaoMap.
  3. Key methods: dispose, render, setGBuffer, setSceneClipBox.

Connects To