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

Method initialize

src/effects/DepthOfFieldEffect.js:536–572  ·  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

534 */
535
536 initialize(renderer, alpha, frameBufferType) {
537
538 this.cocPass.initialize(renderer, alpha, frameBufferType);
539 this.maskPass.initialize(renderer, alpha, frameBufferType);
540 this.bokehNearBasePass.initialize(renderer, alpha, frameBufferType);
541 this.bokehNearFillPass.initialize(renderer, alpha, frameBufferType);
542 this.bokehFarBasePass.initialize(renderer, alpha, frameBufferType);
543 this.bokehFarFillPass.initialize(renderer, alpha, frameBufferType);
544
545 // The blur pass operates on the CoC buffer.
546 this.blurPass.initialize(renderer, alpha, UnsignedByteType);
547
548 if(renderer.capabilities.logarithmicDepthBuffer) {
549
550 this.cocPass.fullscreenMaterial.defines.LOG_DEPTH = "1";
551
552 }
553
554 if(frameBufferType !== undefined) {
555
556 this.renderTarget.texture.type = frameBufferType;
557 this.renderTargetNear.texture.type = frameBufferType;
558 this.renderTargetFar.texture.type = frameBufferType;
559 this.renderTargetMasked.texture.type = frameBufferType;
560
561 if(renderer !== null && renderer.outputColorSpace === SRGBColorSpace) {
562
563 this.renderTarget.texture.colorSpace = SRGBColorSpace;
564 this.renderTargetNear.texture.colorSpace = SRGBColorSpace;
565 this.renderTargetFar.texture.colorSpace = SRGBColorSpace;
566 this.renderTargetMasked.texture.colorSpace = SRGBColorSpace;
567
568 }
569
570 }
571
572 }
573
574}

Callers

nothing calls this directly

Calls 1

initializeMethod · 0.65

Tested by

no test coverage detected