CZML performance

Hello dev group,

We are trying to show a lot of rectangles with dynamic heights based on different times.

The problem is that the frame rate is around 3-5 which is very poor, compared with simple examples where is around 30fps.

I read some subjects regarding performance improvements, also the one using points, but we really want to have rectangles shown, not points or lines.

With 10-50 rectangles, works fine, but with more than 100 the FPS drops a lot.

Is anything we are missing?

Could we increase the performance somehow?

Here is the code (the complete code in the attachment) :

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

scene3DOnly: true,

imageryProvider : new Cesium.MapboxImageryProvider({

mapId: ‘mapbox.light’ }),

baseLayerPicker : false,

contextOptions: {

webgl : {

 alpha : false,
 depth : true,
 stencil : false,
 antialias : false,
 premultipliedAlpha : true,
 preserveDrawingBuffer : false,
 failIfMajorPerformanceCaveat : true

},

allowTextureFilterAnisotropic : false

}

}) ;

viewer.scene.debugShowFramesPerSecond = true;

viewer.scene.skyBox.show = false;

viewer.scene.skyBox.destroy();

viewer.scene.skyBox = undefined;

viewer.scene.sun.show = false;

viewer.scene.sun.destroy();

viewer.scene.sun = undefined;

viewer.scene.moon.show = false;

viewer.scene.moon.destroy();

viewer.scene.moon = undefined;

viewer.scene.skyAtmosphere.show = false;

viewer.scene.skyAtmosphere.destroy();

viewer.scene.skyAtmosphere = undefined;

viewer.scene.fog.enabled = false;

viewer.scene.enableLighting = false;

var czml = […];

var dataSource = Cesium.CzmlDataSource.load(czml);

viewer.dataSources.add(dataSource);

Thanks in advance!!!

CZML_Test.html (113 KB)

Hello,

I don’t think using dynamic rectangles is the best approach here. I would recommend switching to polylines instead. They are much simpler to draw since you need it to update every frame.

That’s what Alex and Ed did for the 3D demo they put together a few years ago: http://cesiumjs.org/demos/d3.html

If you really did want to stick with rectangles, you could try upping the granularity or using a more simple linear interpolation. You could also try switching to a box geometry instead, that should be a little faster.

Best,

Hannah

Thank you Hannah for your reply,

Much appreciated!

We will follow your suggestions (box geometry / granularity) to check the performance.

We will update this post with results after testing.

Regards,