MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / initialize

Method initialize

src/effects/SSAOEffect.js:599–622  ·  view source on GitHub ↗

* Performs initialization tasks. * * @param {WebGLRenderer} renderer - The renderer. * @param {Boolean} alpha - Whether the renderer uses the alpha channel or not. * @param {Number} frameBufferType - The type of the main frame buffers.

(renderer, alpha, frameBufferType)

Source from the content-addressed store, hash-verified

597 */
598
599 initialize(renderer, alpha, frameBufferType) {
600
601 try {
602
603 let normalDepthBuffer = this.uniforms.get("normalDepthBuffer").value;
604
605 if(normalDepthBuffer === null) {
606
607 this.depthDownsamplingPass.initialize(renderer, alpha, frameBufferType);
608 normalDepthBuffer = this.depthDownsamplingPass.texture;
609 this.uniforms.get("normalDepthBuffer").value = normalDepthBuffer;
610 this.ssaoMaterial.normalDepthBuffer = normalDepthBuffer;
611 this.defines.set("NORMAL_DEPTH", "1");
612
613 }
614
615 } catch(e) {
616
617 // Not supported.
618 this.depthDownsamplingPass.enabled = false;
619
620 }
621
622 }
623
624}

Callers

nothing calls this directly

Calls 2

setMethod · 0.80
initializeMethod · 0.65

Tested by

no test coverage detected