# City scale 3d buildings performance problems

**URL:** <https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122>\
**Category:** CesiumJS\
**Created:** [July 6, 2018, 3:25am UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122 "2018-07-06T03:25:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Tian](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Karl\_Tian](https://community.cesium.com/u/Karl_Tian)\
**Post date:** [July 6, 2018, 3:25am UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/1 "2018-07-06T03:25:41Z")

</div>

We put 2000+ 3D buildings(b3dm) into Cesium, but the RAM usage is too high, it looks like the Cesium just load all of them at once.

We are using simple blank models just like the example of the New York City, but much much less fluent when moving the camera.

In fact, as in this profession, the usual way is to set LOD, but how to do that with 3d tiles models? If it's already in tiles?

Can we set to only load screen scale scene and others to be shown as 2D base map particularly while moving the camera, then load their models when fixed?

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [July 6, 2018, 7:26pm UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/2 "2018-07-06T19:26:48Z")

</div>

Have you seen to [3D Tiles specification document](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/1.0/specification)? It explains how to construct the LODs in the tileset JSON file.

Thanks,

Gabby

---

<div class="post-metadata">

**Author:** ![Karl\_Tian](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Karl\_Tian](https://community.cesium.com/u/Karl_Tian)\
**Post date:** [July 9, 2018, 2:40am UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/3 "2018-07-09T02:40:49Z")

</div>

Hi Gabby

Thank you, I read that document,and as I understand that,in the usual way, each model is already split into layers of parent and children and children's children, so I should just give them suitable geometricError values to be displayed at different distance of the camera, thus LOD, right?

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [July 9, 2018, 7:33pm UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/4 "2018-07-09T19:33:21Z")

</div>

Yes, the geometric error is used to determine the screen space error (SSE) for the tile. If the width of the tile in pixels is greater than the SEE, the tile is rendered. The bottom-most children tiles will generally have a geometric error close to 0. You can start with determining the geometric error og the the root tile, and divide by two for each successive LOD. So for instance, if your root tile has an error of 100, the next LOD would have 50, etc.

---

<div class="post-metadata">

**Author:** ![Karl\_Tian](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Karl\_Tian](https://community.cesium.com/u/Karl_Tian)\
**Post date:** [July 10, 2018, 1:40am UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/5 "2018-07-10T01:40:07Z")

</div>

在 2018年7月10日星期二 UTC+8上午3:33:21，Gabby Getz写道：

> Yes, the geometric error is used to determine the screen space error (SSE) for the tile. If the width of the tile in pixels is greater than the SEE, the tile is rendered. The bottom-most children tiles will generally have a geometric error close to 0. You can start with determining the geometric error og the the root tile, and divide by two for each successive LOD. So for instance, if your root tile has an error of 100, the next LOD would have 50, etc.
> 
> On Sunday, July 8, 2018 at 10:40:49 PM UTC-4, karl...@gmail.com wrote:Hi Gabby  
> Thank you, I read that document,and as I understand that,in the usual way, each model is already split into layers of parent and children and children's children, so I should just give them suitable geometricError values to be displayed at different distance of the camera, thus LOD, right?

The last few days I've been studying the New York demo, after I downloaded the data([https://s3.amazonaws.com/cesiumjs/3DTiles/NewYorkCityGml.zip](https://s3.amazonaws.com/cesiumjs/3DTiles/NewYorkCityGml.zip)), T can't open the json file(tileset.json) in Chrome nor notepad, it just show messy, and to put it into VS2017 it shows a binary code, is it encrypted or I just don't know the right way?

And I can't use that data, putting that json file into localhost shows nothing.

As a matter of fact, to load these 700MB models Cesium need more than 1.5GB of RAM, to load my own 1.2 GB models Cesium need nearly 2GB of RAM. For it's your official demo, is there really not some better way to improve that?

Never the less, the New York demo is still much more fluent than mine.It's not the RAM usage problem, I was thinking of LOD, since I can't read the json file, could you please tell my how did you deal with the New York demo?

---

<div class="post-metadata">

**Author:** ![Michele\_Andreolli](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Michele\_Andreolli](https://community.cesium.com/u/Michele_Andreolli)\
**Post date:** [July 10, 2018, 12:19pm UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/6 "2018-07-10T12:19:01Z")

</div>

I have the same issues with my project.

[Here](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html#c=pVRdc9o4FP0rGl5idqiAOOlsE5rZLOlkzcROA24IGV6EfAEttuRKMl87/e97bQOGNNOX8mKke+45914dqdkk95pJS7pgRJb0BoRxDsYQq8hGZZoIJQkzBqwZyxJDPSVpBFOWxfa2AIdqAZJ8Jmew6c0n91w8ip73beu1A+EZT/Yvedf76C3Sl+du7xNF0PfofpGD5qPzIPaH3jbotv99HH47fwifLh5D346GXnskWutg21+8hr1kFC7cUXgrHrq99BXJgnBhvCSeR/jfx5xgO9oE2y+u77YoT+7EyF8O/fbl4mX1d7yaTQfb4CnV7lP2RXrJw8vsYv366cOAP51dj+VYLpkmK6XjKAStmcg72XXKNTALw6OY899YEvxp+J6BsUMMa5+ZxRWxOoPGSfAZtIV1oHTCYlMCxvJH/aC5FLACjWoSVnvF52LPOePFsqukRVHQZw2yE7ZlHV+1WooI9NVJ5Qf6UsCKGPDk3DvUKMWo4SCBplokwoolGMqiyDnSLz/uXVim7tvNdHxFquPvg0FvcKBTrZLb3B1e5Fy67p/1vIKyhIM4xSFGGyw4EQaonYN0ppnkFp3l7ED1fXe/qnKPvT6BbpVKQrUPNo5n+Q/qCjn7Kiyf95mcgdOirQb50KKXjWo2dKIymeMG6Rw0UI1JmSF/kHPaqh/EcJqcaVtZo4srNdMsnQtejCHfwBA7NPUzNXaFx3fMaTI9ZRxOaQsWtyDtYzFMGifXprGSM2GzCBqkXDO7W2Jfx6xqOkX93yW9+HjMafGVMHlQyXeJTTZBCLdOKd7Yt3ZyIhXeOYy2mlaiIoh9ZrVYVxLl+qIoPKxqcI7qeeMIWFuQkbPLLzdPbO1JkwK3SvtiLYrsH3Wq0Jh6hQ6tzIl3SumdNbmSRsWA45rt9q+ru/yeE9279zjJCemvaGuNWsfYTQw3JfIvkaQKDYg30aG0aSFJsXswzUnGF2ApNyZP6zT3SZ1ILImIPo9rb96ScY3wGJ90jEyzOB6ILYxrN50m4k/SYlVcn8cl6JhtEFIW0pm3bx7KEKW008RlLvs22yoVT5g+Yv4f) you can find a Sandcastle demo of my dataset.

I read the 3D Tiles documentation, and the theory behind the specification is quite clear.

Now I have to face the practice.

I have created my tileset through the automatic process of FME (Safe Software), and it works fine, but it is not so good in terms of performance, as you can see.

How can I optimize my tileset? Just changing the geometricError value (but how? This is still unclear for me, sorry!) or should I apply other optimizations?

Thank you,

Michele

[tileset.json](https://community.cesium.com/uploads/short-url/rRMlYs6Ld5OpvhbkyCAAZc8QUw3.json) (111 KB)

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [July 12, 2018, 1:48pm UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/7 "2018-07-12T13:48:19Z")

</div>

Hi karlintc and Michele,

The reason you see the binary code is because the tileset has been compressed with [gzip](https://www.gnu.org/software/gzip/) for a smaller file size.

I’ll need more details to figure out why your tileset isn’t showing up locally. Are you serving it via web server that’s configured for json and gzipped content? Cesium’s [development server](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/server.js) is an example of how to do this.

[Here’s a thread](https://groups.google.com/forum/#!searchin/cesium-dev/3d%2420tiles%2420ram%7Csort:date/cesium-dev/BcbyELEXFHI/2FA4Cvu4CwAJ) to troubleshoot why your browser may be using so much memory. You can also [compress your tiles with Draco](https://cesium.com/blog/2018/04/09/draco-compression/) and gzip your tileset. You can also try playing with the values in the JSON, but as an alternative to other tiling software that may not be meeting your needs, we also have some tiling tools available, please take a look at our [Data Services](https://cesium.com/collaborate-with-us/#data-services) page and contact Tim if you would like to take advantage of them.

Thanks,

Gabby

---

<div class="post-metadata">

**Author:** ![Karl\_Tian](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Karl\_Tian](https://community.cesium.com/u/Karl_Tian)\
**Post date:** [July 12, 2018, 2:42pm UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/8 "2018-07-12T14:42:39Z")

</div>

Hello Gabby

Could you do my a favor and tell me how much RAM the New York demo should normally cost and how much frames while roaming when it works fine?

Because my own work is quite like that one, and if it works fine on your side, then the problem is my own tileset, then I'll try something else to fix, although I still don't understand how to calculate the geometric error and so many other things, like external tilesets.

But if it's the same with you as I pictured, then it's just a performance problem of large scale rendering that need to be solved in the future.

Thank you

---

<div class="post-metadata">

**Author:** ![Michele\_Andreolli](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Michele\_Andreolli](https://community.cesium.com/u/Michele_Andreolli)\
**Post date:** [July 13, 2018, 9:07am UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/9 "2018-07-13T09:07:54Z")

</div>

Hi Gabby,

thank you for your feedback.

I’ve already contacted Tim in order to figure out the issue.

Thanks,

Michele

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [July 16, 2018, 9:31pm UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/10 "2018-07-16T21:31:36Z")

</div>

Hi karlintc,

On my machine the demo uses about 0.2GB of RAM, even when panning and zooming around the scene.

Thanks,

Gabby

---

<div class="post-metadata">

**Author:** ![Karl\_Tian](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@Karl\_Tian](https://community.cesium.com/u/Karl_Tian)\
**Post date:** [July 30, 2018, 6:05am UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/11 "2018-07-30T06:05:32Z")

</div>

Hello

It’s an old topic but recently I’ve made it better.

My computer has a NVIDIA Quadro video card so I never doubt performance ability, but it turns out NOT working at all.

At default, Chrome is handled by Intel’s integrated video card and for daily web surfing it is enough.

But for large scale webgl rendering, you have to manually designated to a much more powerful external video card.

Now it works fine at 60 FPS and I thought it’ll be good to tell others to watch out.

Thank you.

在 2018年7月17日星期二 UTC+8上午5:31:36，Gabby Getz写道：

---

<div class="post-metadata">

**Author:** ![Michele\_Andreolli](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Michele\_Andreolli](https://community.cesium.com/u/Michele_Andreolli)\
**Post date:** [July 31, 2018, 8:06am UTC](https://community.cesium.com/t/city-scale-3d-buildings-performance-problems/7122/12 "2018-07-31T08:06:38Z")

</div>

Hi Karl,

thank you for your feedback… I’ve just tried to force the GPU rendering in chrome, but the system is not yet responsive enough.

It runs a little bit better, but not usable for public deployment. In my case, the issues are strongly related to the 3DTiles generation.

Thanks,

Michele
