engine-toolkit
engine-toolkit copied to clipboard
Frame rate drops when wireframe manager is used for rendering Lottie
- 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
- frame rate drops 2.Spector shows draw triangles multiple times in one frame