AfterimagePass constructor

AfterimagePass(
  1. dynamic damp,
  2. dynamic bufferSizeMap
)

Implementation

AfterimagePass(damp, bufferSizeMap) : super() {
  this.shader = AfterimageShader;

  this.uniforms = UniformsUtils.clone(this.shader["uniforms"]);

  this.uniforms['damp']["value"] = damp != null ? damp : 0.96;

  this.textureComp = new WebGLRenderTarget(
      bufferSizeMap["width"],
      bufferSizeMap["height"],
      WebGLRenderTargetOptions({
        "minFilter": LinearFilter,
        "magFilter": NearestFilter,
        "format": RGBAFormat
      }));

  this.textureOld = new WebGLRenderTarget(
      bufferSizeMap["width"],
      bufferSizeMap["height"],
      WebGLRenderTargetOptions({
        "minFilter": LinearFilter,
        "magFilter": NearestFilter,
        "format": RGBAFormat
      }));

  this.shaderMaterial = new ShaderMaterial({
    "uniforms": this.uniforms,
    "vertexShader": this.shader["vertexShader"],
    "fragmentShader": this.shader["fragmentShader"]
  });

  this.compFsQuad = new FullScreenQuad(this.shaderMaterial);

  var material = new MeshBasicMaterial();
  this.copyFsQuad = new FullScreenQuad(material);
}