SSAONOHPass Class

Module: Postprocessing

Screen space ambient occlusion (SSAO) pass is used to simulate ambient occlusion shadowing effect.

Uses the normal-oriented hemisphere method produces a more realistic-looking than the basic Crysis method.

Based on the article from http:// john-chapman-graphics.blogspot.com/2013/01/ssao-tutorial.html

More information about SSAO here

Methods

generateRandomKernelRotations

()

Use noise to generate multiple pseudo random kernel rotations.

generateSampleKernel

()

Generate a sample kernel based on the kernelSize value.

render

(
  • renderer
  • writeBuffer
  • readBuffer
  • delta
  • maskActive
)

Render using this pass.

Parameters:

  • renderer WebGLRenderer
  • writeBuffer WebGLRenderTarget

    Buffer to write output.

  • readBuffer WebGLRenderTarget

    Input buffer.

  • delta Number

    Delta time in milliseconds.

  • maskActive Boolean

    Not used in this pass.

renderPass

()

Render a quad scene using a pass material.

setSize

(
  • width
  • height
)

Set resolution of this render pass.

Parameters:

  • width Number
  • height Number

toJSON

(
  • meta
)

Serialize pass to json.

Parameters:

  • meta Object

    Metadata object.

Properties

kernelRadius

Boolean

Kernel radius used for the SSAO effect.

kernelSize

Number

SSAO effect kernel size.

maxDistance

Number

Maximum camera distance considered for the SSAO effect.

minDistance

Number

Minimum camera distance considered for the SSAO effect.

Attributes

blurMaterial

ShaderMaterial

Blur pass render material.

copyMaterial

ShaderMaterial

Material used to copy data between buffers.

depthTexture

DepthTexture

Depth texture attached to the normal material

normalMaterial

MeshNormalMaterial

Normal rendering material.

ssaoMaterial

ShaderMaterial

Shader material for the SSAO render pass.