Rendering time for normal Gltf and Draco compressed Gltf using gltf-pipeline

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

I have been exploring different features of CesiumJS. In the process, I am trying to load a BIM as a model without tiling. I have taken a large BIM(.obj format) of size 280MB. Converted it into ‘gltf’ using obj2gltf.

Now using gltf-pipeline, I have applied Draco compression - the command used:

“gltf-pipeline -i phx_glb_uncompressed.gltf -o modelDraco0.glb -d --draco.compressionLevel 0 -b”

However, when loading the glb as entity(pls see code below), the globe will be shown first and after some time, the viewer is getting zoomed to entity. If I use normal gltf( i.e one without applying draco compression using gltf-pipeline) it gets rendered faster.

I tried debugging the code, but couldn’t understand which process is taking so much time to load the model on the viewer.

If someone could help me understand the process, it will be really helpful. Also, how can I reduce the time to render Draco compressed model? Thank you.

the files used : https://drive.google.com/drive/folders/1fse-hrQMioyVfjvTpFDCwty-tg97ALNd?usp=sharing

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

Sample code:

var entity = viewer.entities.add({

name : “http://localhost:8003/tilesets/LakesideRestaurant.glb”,

//name : “http://localhost:8003/tilesets/LakesideRestaurant.gltf”,

position : position,

orientation : orientation,

model : {

uri : “http://localhost:8003/tilesets/LakesideRestaurant.glb”,

//uri : “http://localhost:8003/tilesets/LakesideRestaurant.gltf”,

minimumPixelSize : 128,

maximumScale : 20000

}

});

viewer.trackedEntity = entity;

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

I wanted to understand how the Draco compression helps in the faster rendering of the 3d BIM model

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

cesium 1.62, Ubuntu 16.04 Lts, chrome

Draco compressed models are decoded using a Web Assembly module. Since this is large, CesiumJS won’t load it until it’s needed. So the first time you load a Draco model there will be an extra delay because of this. You should be able to confirm this by deleting the model and recreating it. The second time should be a lot faster.

Also, if you have large models and you want them to be shown as fast as possible, you should tile them as 3D Tiles. The tile contents will be Draco compressed. This way you can see the model immediately and load higher LODs as you zoom in. Have you tried uploading your source model to Cesium ion (https://cesium.com/ion) ?

Thank you for the reply, Omar.

I’d tried a few things and wanted to update my findings.

I’ve split up the main .obj (of 150 MB) into 5 draco compressed glbs of 1.8 MB each. Created a tileset.json to incrementally load them as tiles with Geometricerror as 0
The entire loading took about 4 minutes to complete. Screenshot of my profiler below… (root:24 s, child 1: 56 s, child 2: 114 sec, child 3: 185 s, child 4: 280 s)

Screenshot 2019-10-30 at 1.23.04 PM.png

Although I’ve been able to reduce the size of b3dms greatly by draco compression & the network time has gone down (~5 sec incl. draco_decoder). The complete rendering is taking too long. Not sure if I’m doing something wrong. I don’t see much activity in the worker threads either.

  1. Regarding tiling with ion, it is improving the performance a lot. But I want to preserve the per feature attributes like id/name, Ion seems to ignore these attributes during optimizing the tiles. If there is a way to retain the original meshes and their attributes with ion hierarchial split, please let me know.