Performance hit with a large amount of polygons for displaying thunderstorms etc

Hello Cesium Community / Staff,

I’ve been working on a project that displays time-dependent 2D weather areas on the globe, with some additional text and an icon, for one day. That means I am basically loading 3000 polygons from a backend service, parsing them, and adding them to the globe as entities containing a PolygonGraphic, a BillboardGraphic, a PolylineGraphic (to draw a thick outline since polygon outlineWidth > 1 is not supported), a LabelGraphic and an availability TimeInterval to show them only when they are active. Everything is working great so far when I move the timeslider, the only problem is the performance hit I get after adding the 3000 polygons/billboards/labels, which takes my FPS from constant 60 to about 23 at best, even when I let cesium sit and load for a while to make sure it is done processing in the background.
It looks like this:

grafik

Do you guys have any recommendations to improve performance for this scenario?

  • Would migrating to the Primitive API help?
  • Is 3DTiles Streaming an option here?
  • Are polygons that are not displayed because of their availibillity still affecting performance?

I already searched the forums for similar questions, and the closest I have found is this:

It seems to be unanswered, but I have read in another post that polylines are sometimes the problem

Thanks, Noah

You could try to combine your geometries.

  1. Craete Geometry .
  2. push Geometry into a GeometryInstance array.
  3. Create a Primitive with geometryInstances.

Then you will get one primitive rather than a lot of entities that is helpful of performance.

I made some suggestion in this recent post about entity management and performance tricks, maybe some of them could help;

Cheers,

Alex

Thanks @Gu-Miao and @Alexander_Johannesen for your suggestions, I will look into it, already done an experimental sandcastle and the performance looks way better.

Another question, if I use the Primitive API for this, I will lose the comfort of having an Entity Availability TimeInterval (and properties in general) to display the polygon only on their active times. Does anybody have a handy solution/idea for this? Otherwise I’ll have to roll my own implementation

Further suggestions are still welcome! :smiley:

Thanks,
Noah

Try using c137.js and let me know if the frame rate is any better. There’s a few optimizations in there for entities.