I need to render 10000+ polygons and update the polygonHierarchy in every 50ms. If I use Entity CallbackProperty, the performance is in a low level. If I use PrimitiveCollection,I don’ t find a way to update the geometry, I can only remove and create them, the polygons flashed and the performance is still in a low level. Is there a good way to solve it? like PolygonCollection? Tks!
I’m just another user, not part of the team, but that sounds like a pretty tall order to me. Are all 10k polygons on screen at once typically? If not, you can hook camera movement events and dynamically add/remove entities.
I’m also curious to hear how you are using CallbackProperty. I’ve had pretty good results using a pattern like
let myHierarchy = new PolygonHierarchy(somePoints);
new Entity({
polygon: {
hierarchy: new CallbackProperty(() => myHierarchy, false),
material: Color.RED,
}
});
// When points actually change
myHierarchy = new PolygonHierarchy(updatedPoints);
but that’s for tens or hundreds of polygons, not 10k.
I would try that approach, and if performance isn’t satisfactory, try using a fixed hierarchy (polygon: { hierarchy: new PolygonHierarchy(initialPoints) } }
) then updating it (myEnt.polygon.hieararchy.positions = newPoints
), but be sure to put a call to EntityCollection#suspendEvents before you start updates, then call resumeEvents
when all entities are updated.