loading a large amount of 3D models

I plan to load a large amount of 3D models on Cesium, including 400,000 building models, 500,000 tree models, 150,000 road lamp, 20,000 traffic light.
For handling the models to smoothly rendering on Cesium, I design a tile-liked scheme.

First, I try to load the 500,000 tree models using the scheme.

The idea is very simple:

  1. Divide the geographical range of the city into amounts of tiles, named with s?x???y???. The models fall in each tile are packed into the s?x???y??? .czml. There are 1,425 czml files in total.

  1. detect which czml files should be loaded.

var posLR = scene.camera.pickEllipsoid(new Cesium.Cartesian2(viewer.canvas.width, viewer.canvas.height), ellipsoid);

var posLL = scene.camera.pickEllipsoid(new Cesium.Cartesian2(0, viewer.canvas.height), ellipsoid);

   var cartographic_LL = ellipsoid.cartesianToCartographic(posLL);

  var LL_lon = Cesium.Math.toDegrees(cartographic_LL.longitude);

  var LL_lat = Cesium.Math.toDegrees(cartographic_LL.latitude);

   var cartographic_LR = ellipsoid.cartesianToCartographic(posLR);

  var LR_lon = Cesium.Math.toDegrees(cartographic_LR.longitude);

  var LR_lat = Cesium.Math.toDegrees(cartographic_LR.latitude);

   if ((LR_lon-LL_lon)/2<f_length_x)  // simple way,need to be modified.

   {

       framx=Math.floor((LL_lon-base_x)/f_length_x);

       framy=Math.floor((base_y-LL_lat)/f_length_y)+2;

      if (HadLoad[framx][framy]==0)

       {

var czmlfile=“Model/tree/4/s4x”+framx.toString()+“y”+framy.toString()+".czml";

workQueue= new WorkQueue(showBuilding(czmlfile));

HadLoad[framx][framy]=1;

           }

}

function showBuilding(file)

{

viewer.dataSources.add(Cesium.CzmlDataSource.load(file));

}

The scheme seems works as shown in the video: http://youtu.be/HG5ifpfncBU

My observations:

  1. the performance is good when the scene only cover a small area, no matter what the models had been load or not.

  2. the performance is also good even the scene cover a lager range if the models had not been load.

  3. the performance is bad if many models had been loaded in the scene. (at 2’10’’ in the video)

My question:

  1. Can I hidden(or unload) some of the loaded czml files( or models) if needed (ex: when they are far from the viewpoint) ? and how to do?

Once czml models are loaded I’m not sure how to access them for adjustment or removal. It looks like Cesium is developing a 3D model tiling scheme (3D building being just one category of 3D models)

https://groups.google.com/forum/#!topic/cesium-dev/IArj5ju4cI8

I’m guessing it will use the same tile system as does imagery and terrain

You could probably use this new system for all of these models you’re adding once it debuts. Does the models you’re using have multiple LOD versions by chance?