ClassificationPrimitive bad performance

Hello,

We work on a project were we have to display a tileset and something like 250 geometries.
Our first implementation to display and interact with those geometries work well with Entity (Polygon) but we would like improve the projection of them on the tileset.
Capture d’écran 2024-05-28 à 11.35.06

To improve visual result we have changed our code to provide BoxGeometry and use them in ClassificationPrimitive.

The visual result is highly improved, but the performance is dramatically bad.
While with Entity we have no freeze at any time, with ClassificationPrimitive, loading tiles is totally freeze at least 20sec (for 250 Geometries) and primitives are displayed one by one.
Capture d’écran 2024-05-28 à 11.35.24

Once primitive are loaded, tiles are back, but navigate in/around the tileset is not at all fluid.
ClassificationPrimitive are all pushed in a PrimitiveCollection which is added to the scene.
ClassificationPrimitive use default value asynchronous=true.
So we don’t see how to solve this problem.
Any help will be appreciate.
Regards

After a lengthy investigation, we found out what was causing the poor performance.
The project is developed in Angular (Typescript).
So we wrote a lot of functions with typed parameters and returning typed values.
In doing so, the Cesium declaration in typind.d.ts didn’t seem sufficient and we had to add import * as Cesium from ‘cesium’; to our various files to be able to use types.
And this is what led to poor performance.
Removing all the import * as Cesium from ‘cesium’; and changing all the types to any solved the problem.
We can’t explain why any more. But we are now able to display a thousand ClassificationPrimitives in one second.
Regards

1 Like