EffectComposer constructor

EffectComposer(
  1. WebGLRenderer renderer,
  2. WebGLRenderTarget? renderTarget
)

Implementation

EffectComposer(this.renderer, WebGLRenderTarget? renderTarget) {
  if (renderTarget == null) {
    var parameters = {"minFilter": LinearFilter, "magFilter": LinearFilter, "format": RGBAFormat};

    var size = renderer.getSize(Vector2(null, null));
    _pixelRatio = renderer.getPixelRatio();
    _width = size.width.toInt();
    _height = size.height.toInt();

    renderTarget = WebGLRenderTarget(
        (_width * _pixelRatio).toInt(), (_height * _pixelRatio).toInt(), WebGLRenderTargetOptions(parameters));
  } else {
    _pixelRatio = 1;
    _width = renderTarget.width;
    _height = renderTarget.height;
  }

  renderTarget1 = renderTarget;
  renderTarget2 = renderTarget.clone();
  renderTarget2.texture.name = 'EffectComposer.rt2';

  writeBuffer = renderTarget1;
  readBuffer = renderTarget2;

  renderToScreen = true;

  passes = [];

  // dependencies
  copyPass = ShaderPass(copyShader, null);

  clock = Clock(false);
}