render method
dynamic
render(})
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.
}