AfterimagePass constructor

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

Implementation

AfterimagePass(damp, bufferSizeMap) : super() {
  shader = afterimageShader;

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

  uniforms['damp']["value"] = damp ?? 0.96;

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

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

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

  compFsQuad = FullScreenQuad(shaderMaterial);

  var material = MeshBasicMaterial();
  copyFsQuad = FullScreenQuad(material);
}