beforeFinalize(frameState) {
    const helper = this.helper;
    const gl = helper.getGL();
    const canvas = helper.getCanvas();
    const screenWidth = canvas.width;
    const screenHeight = canvas.height;

    if (
      this.renderedWidth_ != screenWidth ||
      this.renderedHeight_ != screenHeight
    ) {
      this.createSizeDependentTextures_();
    }

    const size = [screenWidth, screenHeight];

    // copy current frame buffer to the velocity texture
    this.velocityTexture_ = helper.createTexture(
      size,
      null,
      this.velocityTexture_,
    );
    gl.copyTexImage2D(
      gl.TEXTURE_2D,
      0,
      gl.RGBA,
      0,
      0,
      screenWidth,
      screenHeight,
      0,
    );

    this.drawParticleTrails_(frameState);
    this.updateParticlePositions_(frameState);

    frameState.animate = true;
    this.renderedWidth_ = screenWidth;
    this.renderedHeight_ = screenHeight;
  }
@override
@param {import("../../Map.js").FrameState} frameState Frame state.