SSAARenderPass constructor

SSAARenderPass(
  1. dynamic scene,
  2. dynamic camera,
  3. dynamic clearColor,
  4. dynamic clearAlpha,
)

Implementation

SSAARenderPass(scene, camera, clearColor, clearAlpha) : super() {
  this.scene = scene;
  this.camera = camera;

  this.sampleLevel =
      4; // specified as n, where the number of samples is 2^n, so sampleLevel = 4, is 2^4 samples, 16.
  this.unbiased = true;

  // as we need to clear the buffer in this pass, clearColor must be set to something, defaults to black.
  this.clearColor = clearColor ?? Color.fromHex(0x000000);
  this.clearAlpha = clearAlpha ?? 0;
  this._oldClearColor = new Color(0, 0, 0);

  if (CopyShader == null) print('THREE.SSAARenderPass relies on CopyShader');

  var copyShader = CopyShader;
  this.copyUniforms = UniformsUtils.clone(copyShader["uniforms"]);

  this.copyMaterial = new ShaderMaterial({
    "uniforms": this.copyUniforms,
    "vertexShader": copyShader["vertexShader"],
    "fragmentShader": copyShader["fragmentShader"],
    "premultipliedAlpha": true,
    "transparent": true,
    "blending": AdditiveBlending,
    "depthTest": false,
    "depthWrite": false
  });

  this.fsQuad = new FullScreenQuad(this.copyMaterial);
}