Cesium limits for huge number of entities

Hi all,

I am a little bit surprised, I am trying to visualize some radar plots into Cesium view and it seems that the limits in term of number of entities are reached quite quickly.

Restarting from SandCastle geometry sample the following code :

var viewer = new Cesium.Viewer(‘cesiumContainer’, { infoBox : false });

var entities = viewer.entities;

var i;

var height;

var positions;

var stripeMaterial = new Cesium.StripeMaterialProperty({

evenColor : Cesium.Color.WHITE.withAlpha(0.5),

oddColor : Cesium.Color.BLUE.withAlpha(0.5),

repeat : 5.0

});

var m = Cesium.Color.fromRandom({alpha : 0.5});

// ellipse

/*

for (i = 0; i < 12000; ++i) {

height = 20.0 * i;

entities.add({

    position : Cesium.Cartesian3.fromDegrees(-65.0, 35.0),

    ellipse : {

        semiMinorAxis : 200000.0,

        semiMajorAxis : 200000.0,

        height : height,

        material : m

    }

});   

}

*/

// sheres

for (i = 0; i < 1000; ++i) {

height = 100.0 + (200.0 * i);



entities.add({

    position : Cesium.Cartesian3.fromDegrees(-98.0, 45.0, height),

    ellipsoid : {

        radii : new Cesium.Cartesian3(67500.0, 67500.0, 67500.0),

        outline : true,

        outlineColor : Cesium.Color.WHITE,

        outlineWidth : 2,

        material : Cesium.Color.fromRandom({alpha : 0.5})

    }

});

}

is crashing approximatively for 1000 spheres or 12000 ellipses.

I get this kind of error :

RangeError: Array buffer allocation failed
at new ArrayBuffer ()
at new Float32Array (native)
at Object.GeometryPipeline.encodeAttribute (http://cesiumjs.org/Cesium/Source/Core/GeometryPipeline.js:719:26)
at geometryPipeline (http://cesiumjs.org/Cesium/Source/Scene/PrimitivePipeline.js:182:42)
at Object.PrimitivePipeline.combineGeometry (http://cesiumjs.org/Cesium/Source/Scene/PrimitivePipeline.js:278:26)
at combineGeometry (http://cesiumjs.org/Cesium/Source/Workers/combineGeometry.js:12:41)
at http://cesiumjs.org/Cesium/Source/Workers/createTaskProcessorWorker.js:56:42

Any recommendations when there is a need for handling a lot of geometries at the same time ?

Thanks a lot,

Sébastien

You can try messing around with the granularity option to render each ellipsoid with less detail.

thanks for the tip, I finally moved to a simplest representation using :

var sphereEntity = {
    id: feature.id,
    position: position,
    show: true,
    point: {
        pixelSize: feature.properties.pixelSize,
        color: Cesium.Color.fromCssColorString(color)
    }
};
plotsEntities.entities.add(sphereEntity);

But if anyone has good recommendations to deal with huge set of entities, I am very interested.

Bye
Seb