Polyline and Polygon rendering performance

1. A concise explanation of the problem you’re experiencing.

I’m currently rendering 1200+ Closed polylines using the groundPrimitives API and the same number again of Polygons using the entities API clamped to 3D terrain. I am hitting some performance issues, frame rate dropping to 10 FPS.

I am rendering the polylines since polygons don;'t render outlines on terrain.

I am rendering the polygons for picking purposes so for the most part they are 100% transparent, however they are made visible when the user hovers over them.

I guess i am just hitting the limits on whats possible, maybe but there are a few things that would help me:

  1. When polygons are transparent they still render even though they have no effect on the output fragments - is there a way to prevent this (I know about fill:false and have tried it in combo with allowPicking)

  2. When fill is set to false, the performance hit goes away from the polygons but mouse hover picking does not work (is that a bug?? Mouse clicking still seems to work just not mouse hover)

  3. Even the 1200 odd polylines are taking too big a performance hit, does anyone have any ideas of how to optimise the polyline rendering pipeline - I am happy to work on the Cesium source I just know that someone has already worked pretty hard to optimise polylines on terrain already.

  4. What is the reason that polygon outlines won’t render on the terrain - ie if you try, you get a message that it is not supported?

I have tried the PolygonP

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

//Creating Polylines
/* LOOP>>*/

var instance = new Cesium.GeometryInstance({

               geometry : new Cesium.GroundPolylineGeometry({

               positions : positions,

               width : 2.0


               attributes : {

                   color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLACK)



var groundPolylines = new Cesium.GroundPolylinePrimitive({

       geometryInstances : groundPolyinePrimitives,

       appearance : new Cesium.PolylineColorAppearance({translucent : false, flat : true}),

       allowPicking : false



//Creating Polygons
//The Polygons are giving the biggest performance hit, even when the Color is transparent, they still seem to render.
//They are there so that I can use mouse hover picking, and in they are displayed when the mouse hovers.
/*Loop >> */

var added = self.viewer.entities.add({

               name : key,

               polygon : {

                   hierarchy : positions,

                   outline : false,

                   /*fill : false,// I want to set fill to false but then mouse hover does not work...*/

                    material : Cesium.Color.TRANSPARENT,

                   clampToGround : true




3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I need to render outlines of shape files on 3D terrain and also the enclosed area as either 100% transparent or semitransparent fill. I also need to be able to mouse hover pick polygons, even when they are not visible.

4. The Cesium version you’re using, your operating system and browser.

Cesium 1.66