render method

  1. @override
dynamic render(
  1. dynamic renderer,
  2. dynamic writeBuffer,
  3. dynamic readBuffer, {
  4. num? deltaTime,
  5. bool? maskActive,
})
override

Implementation

@override
render(renderer, writeBuffer, readBuffer, {num? deltaTime, bool? maskActive}) {
  uniforms['tOld']["value"] = textureOld.texture;
  uniforms['tNew']["value"] = readBuffer.texture;

  renderer.setRenderTarget(textureComp);
  compFsQuad.render(renderer);

  copyFsQuad.material.map = textureComp.texture;

  if (renderToScreen) {
    renderer.setRenderTarget(null);
    copyFsQuad.render(renderer);
  } else {
    renderer.setRenderTarget(writeBuffer);

    if (clear) renderer.clear(true, true, true);

    copyFsQuad.render(renderer);
  }

  // Swap buffers.
  var temp = textureOld;
  textureOld = textureComp;
  textureComp = temp;
  // Now textureOld contains the latest image, ready for the next frame.
}