engine-toolkit icon indicating copy to clipboard operation
engine-toolkit copied to clipboard

Frame rate drops when wireframe manager is used for rendering Lottie

Open JujieX opened this issue 1 year ago • 0 comments

  • use case
  _addEntityWireframe(entity: Entity, excludeComponent: Component = null, includeChildren = true): void {
    if (!this._visible) return;
    const wireframeManager = this._wireframeManager;

    if (includeChildren) {
      const components = new Array<SpriteRenderer>();
      entity.getComponentsIncludeChildren(SpriteRenderer, components);
      for (let i = 0, n = components.length; i < n; i++) {
        const component = <SpriteRenderer>components[i];
        if (component !== excludeComponent) {
          wireframeManager.addRendererWireframe(component);
        }
      }
    } else {
      const renderer = entity.getComponent(SpriteRenderer);
      if (renderer && renderer !== excludeComponent) {
        wireframeManager.addRendererWireframe(renderer);
      }
    }
  }
  • lottie file address https://mdn.alipayobjects.com/fin_antassetrepobe/afts/file/A*QTt_Qrg6oFkAAAAAAAAAAAAADvd4AQ

  • phenomenon

  1. frame rate drops 2.Spector shows draw triangles multiple times in one frame

JujieX avatar Jun 19 '23 07:06 JujieX