Multicolor polylines problem

When displaying simple polylines with colors, displaying 1000 lines in white works normally.
But displaying different colors on the lines, the globe is not responsive to panning or zooming.

//Code used in sandcastle….
for(var i = 0; i < 1000; i++)
{
var polyline = polylines.add();
polyline.setPositions(ellipsoid.cartographicArrayToCartesianArray([
Cesium.Cartographic.fromDegrees(-110.0 + i * .01, -42.0 + i * .1),
Cesium.Cartographic.fromDegrees(-120.0 + i * .01, -26.0 + i * .1)
]));
var newColorMat = Cesium.Material.fromType(undefined, Cesium.Material.ColorType);
newColorMat.uniforms.color = new Cesium.Color(i/1000, 1, i/1000, 1.0);
polyline.setMaterial(newColorMat);
}

Is there a better way to display colored lines ( a lot of them) where the globe will be more responsive…

Hi Tom,

Polylines are batched per material so they perform best when the relationship between materials and polylines is few-to-many. We are working on some optimizations that will enable unique colors for a large number of static polylines. Keep an eye out here and on our roadmap for updates. It should be released in b18 on July 1.

Regards,

Patrick