If you do have time at some point I'd love to know if I was doing something wrong with the entity approach. From all I've read about the Entity API it seems like updating the size and color of 1000 ellipsoids shouldn't be a big deal from a performance standpoint.
My last attempt at the entity approach (after I updated the getColor and getVisiblity methods per your direction) had everything working. The performance, however, was really poor.
I see that the EllipsoidGraphics subdivisions, stackPartitions and slicePartitions are properties. So I'm suspicious that the performance hit is because I'm not setting these properties correctly in the CallbackProperty functions.
In order to get the material property to update correctly the ColorMaterialProperty had to be set with the CallbackProperty function.
Can someone explain to me how to properly set the subdivision, stackPartition and slicePartition properties in a CallbackProperty function? I'm not sure what property object to use.
Here's the creation of the ellipsoid entity I'm using...
cesiumViewerEntities.add({
parent: vorEntities,
position: Cesium.Cartesian3.fromDegrees(LON, LAT, 0.0),
ellipsoid: {
radii: new Cesium.CallbackProperty(getSize, false),
material: new Cesium.ColorMaterialProperty(new Cesium.CallbackProperty(getColor(MON), false)),
show: new Cesium.CallbackProperty(getVisibility(MON), false),
subdivisions: new Cesium.CallbackProperty(getSubdivisions, false)
stackPartitions: new Cesium.CallbackProperty(getPartitions, false),
slicePartitions: new Cesium.CallbackProperty(getPartitions, false)
},
MON: MON
});
I've realized that this issue is related to using 3D terrain. Whether I use primitives or entities I can't force the ellipsoids or points onto the surface when I am using 3D terrain. Is there any way to force the ellipsoids or points to sit on the surface?
Below is a simple example for Sandcastle. If you zoom in close to the point and tilt the globe you'll see that the point is elevated. If you comment out the terrain provider then the point will be sitting on the globe.
@Matt_Amato I know this is a really old thread but I stumbled on it really struggling to get the best performance when playing back data. I was using a SampledPositionProperty but my FPS would drop really low (~3 FPS) as more data is added. The memory would reach around 250 MB which is higher than I’d like but acceptable.
When I tried using callbacks the memory was amazingly low (staying below 100 MB) but the FPS was a bit worse than using SampledPositionProperty. I suspect the processing I’m doing each time a callback is made.
After reading your suggestion earlier in this thread about the TimeIntervalCollectionProperty, I tried a TimeIntervalCollectionPositionProperty. This turned out to be a great option! The memory usage was about equal to the SampledPositionProperty but the FPS was great. Even with a lot of data (close to 200K points during playback) it never dipped below 10 FPS.
Anyway, there may be room for further performance improvements but I just wanted to say thanks to you and put this out there if anyone else is struggling with playing back a large amount of data.