I’ve noticed a massive performance drop zooming / panning about 10 000 polygons (just material and outline color) in 3D mode. When I switch to 2D, user actions such as zooming / panning is seamless with a good frame rate. The data is fairly small polygons and only visible below 200 meters. These geometries are added as entities (not primitives) as interaction such as selection is required. Must be stated that for testing purposes, we only used one data source and manually added the geometries as entities. Secondly, we switched over to czml, streaming packets, and yet get the same sluggish behavior. Must be noted that it is only on very low zoom levels (below 200 meters). Data is just added, without any blocking callbacks / events on a entity. Also, standard configuration of the viewer and scene is used, without terrain modeling.
Current configuration:
Cesium.Camera.DEFAULT_VIEW_RECTANGLE = Cesium.Rectangle.fromDegrees(0.0, -90.0, 45.0, 90.0);
_viewer = new Cesium.Viewer("cesiumContainer", {
timeline: false,
animation: false,
baseLayerPicker: false,
mapMode2D: Cesium.MapMode2D.ROTATE,
homeButton: false,
fullscreenButton: false,
geocoder: false,
selectionIndicator: true,
infoBox: false,
sceneModePicker: false,
navigationHelpButton: false,
imageryProvider: basemapProvider,
navigationInstructionsInitiallyVisible: false
});
var imageryLayers = _viewer.scene.imageryLayers;
var layer = imageryLayers.get(0);
layer.brightness = 1.66;
layer.contrast = 0.98;
layer.hue = 0;
layer.saturation = 0.12;
layer.gamma = 0.64;
_viewer.scene.debugShowFramesPerSecond = true;
_viewer.scene.skyBox.show = false;
_viewer.scene.sun.show = false;
_viewer.scene.moon.show = false;
_viewer.scene.skyAtmosphere.show = false;
_viewer.scene.globe.enableLighting = false;
_viewer.scene.globe.baseColor = Cesium.Color.BLACK;
_viewer.scene.globe.showWaterEffect = false;
_viewer.scene.fog.enabled = false;
``
For example, here a sample of a polygon:
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var smallPolygon = viewer.entities.add({
name : 'Red polygon on surface',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([
27.2747099421817, -25.60108977515325,
27.274709150589174, -25.601113652028488,
27.27472252196618, -25.601136392020674,
27.2747224601031, -25.601174664970276,
27.274735483425083, -25.601175777853587,
27.274747320254114, -25.60117171169012,
27.27480902991559, -25.60115443613326,
27.274851417384834, -25.6011371336864,
27.274900758640445, -25.601117841325756,
27.27492124935889, -25.60111084328236,
27.274939898269473, -25.601108118286657,
27.274993484092036, -25.60109052394304,
27.275028164504903, -25.60108537673233,
27.275054080340446, -25.601086997906502,
27.275062098454974, -25.601128153198367,
27.27506835401938, -25.60112990161953,
27.27507483777725, -25.601126964799768,
27.275071461303934, -25.601056554555057,
27.2750718196103, -25.60102172018674,
27.27507936103499, -25.60101116291679,
27.275096311518336, -25.601001418392602,
27.275094710012627, -25.60098889246872,
27.27508925501885, -25.60097157163726,
27.275087367389122, -25.600951463897686,
27.275089145387877, -25.600928009415334,
27.27508313718588, -25.60083858504905,
27.275076372390273, -25.600845476722813,
27.2750666706811, -25.600855360391964,
27.275066491536432, -25.600890185397396,
27.27506937018571, -25.600951858820245,
27.275070524925716, -25.60099101408948,
27.275071156207044, -25.600994081082547,
27.275053781858926, -25.600995694291356,
27.27505117223284, -25.60097328612354,
27.27503839350152, -25.60097029527289,
27.275015390831466, -25.60097580866637,
27.274996161847223, -25.600977343249827,
27.27498403908589, -25.600982601483853,
27.274925681804482, -25.60099879664417,
27.274879334314992, -25.601016927978836,
27.274872789605293, -25.601023683161305,
27.27485514686277, -25.601031082041924,
27.274826020267152, -25.601040181455424,
27.274819749228648, -25.60104472460128,
27.274800623388007, -25.601047838622282,
27.274754225821276, -25.60105714198523,
27.2747369454194, -25.601057571626473,
27.274733949365757, -25.60105580632495,
27.2747099421817, -25.60108977515325]),
material: Cesium.Color.WHITE.withAlpha(0.5),
height: 0,
outline: true,
outlineColor: Cesium.Color.WHITE
}
});
viewer.zoomTo(viewer.entities);
``
Just a few questions on this:
- I’ve read through the documentation / forums and tried various performance tweaking, but still get slow user interaction with regards to panning / zooming. Since the user experience in 2D is great, what would cause this in 3D? Don’t think it’s related to the amount of data (geometries). Should I rather switch to primitives, and discard entities?
- There is a bug on the mouse wheel when zooming in on these smaller polygons, where it just all the sudden snaps to the opposite side of the globe. Any tips to prevent this? The delta on the mouse-wheel on such a low levels is also not ideal.
- What would cause this semi-transparent circle in the center of the screen? See attached image. Is it part of some internal diagnostics? Verified on Firefox and Chrome (latest versions)
I’m using the latest version (1.30)…
Any advice / tips for improvement will be appreciated.
Andries