3D model texture not smooth

I had loaded a lots of 3D building models. The texture of models look not smooth in the far view, however they look better in a near view. Do I miss some setting for Cesium or Collada2gltf?

sksu...@gmail.com於 2015年4月17日星期五 UTC+8上午11時48分58秒寫道:

I had loaded a lots of 3D building models. The texture of models look not smooth in the far view, however they look better in a near view. Do I miss some setting for Cesium or Collada2gltf?

far view

near view

Is there a way to find out what texture filtering mode WebGL is using, such as bilinear or trilinear? Do the models have texture and/or geometry LOD levels?

Thanks, Hyper Sonic

  1. from texture.js, I guess the default sampling mode is bilinear.
    var minFilter = TextureMinificationFilter.LINEAR;

var magFilter = TextureMagnificationFilter.LINEAR;

  1. The models have’t LoD levels.

  2. I guess the problem may caused by the anti-aliasing. I add the code: “viewer.scene.fxaa = true;” to set anti-aliasing on. However, the result have not improved.

Any suggestion?

Does setting viewer.scene.globe.maximumScreenSpaceError = 1; help by chance? Default is 2. It might not affect models though.

Hi, Hyper Sonic

following your suggestion, I add viewer.scene.globe.maximumScreenSpaceError = 1;

the result, as attached, have not improved.

Make sure mipmapping/trilinear filtering is enabled in the original COLLADA model.

maximumScreenSpaceError is only for the terrain/imagery and will have no effect here.


Many thanks to Patrick & Hyper
The problem had solved.

I change the code in original COLLADA












The results are perfect, shown as the attached.

Next, I will plan to migrate the 400,000 building models from GE (http://adm3d.taipei.gov.tw/) to Cesium.


Kevin Sun

That does look much better. I noticed that GE has model LODs. If you quickly approach a model from a distance you can momentarily see a lower LOD version before it switches to a higher LOD version. I wonder if GE creates the lower LOD versions at run time, or are those pre-processed and stored into the model itself. I assume Cesium will have something similar to maximumScreenSpaceError for models.

Looks great Kevin! When it is ready, can we showcase this app on the Cesium website: http://cesiumjs.org/demos.html



Dear Patrick

Thanks a lots!

That would be my pleasure. When I have done this work, I will send the App hyperlink to you.

Some additional questions:

  1. Does cesium have any plan to implement the streaming of the building models, like the terrain streaming mechanism? I had implement a Kinect app combine with the 3D City models using Skyline. The 3DML format used by Skyline has an impressive rendering performance.

the video: https://www.youtube.com/watch?v=AhyiAUYUjic

  1. On GE, I handle the 400,000 building models for display smoothly using the Region/LoD. Does cesium has the similar mechanism like Region/LoD?

Kevin Sun

That’s a cool video using Kinect and arm flapping to simulate flying through the city like a bird! Holding weights while flying across a city might make a fun workout routine.

“Regions also specify how big their rectangle or box must look on your screen before it is considered active or inactive. This measurement is the square root of the area the region consumes on your screen, measured in pixels.
For example, if you specify that the flat region (below left) has a minLodPixels of 128, it must appear to be at least 128 x 128 pixels in size in Google Earth before it is active.”

So basically it won’t become visible unless it takes a certain amount of Solid Angle on your screen http://en.wikipedia.org/wiki/Solid_angle which corresponds to a certain amount of pixels. Apparently regions is part of the KML spec https://developers.google.com/kml/documentation/regions#altitude So each of the 400,000 buildings has it’s own region defined?

On GE,I divide the geographical range of the city into amounts of frames, each frame further divide into 5 zoom levels, like the concept of the tiles. Each frame has it’s own region defined. When a frame is considered active, then load the corresponding building models which are stored in a kmz file.

Does Cesium has a similar mechanism like region?

Is it possible to implement this by “building model Tile”?

My idea:

(1) divide the geographical range of the city into amounts of tiles/zoom level.

(2) store the building models in folders(tiles) named as L16X109785Y23650, L17X219570, …

(3) use Cesium API (???) to detect which tiles are active, and then load the corresponding models stored in the folders.


Maybe instead of regions, simply use Cesium’s existing tile structure not only for triangle mesh and imagery, but for models as well. For each model LOD specify at which tile LOD range it is to be shown. This way you don’t have to bother with setting up regions, rather on how to correlate model LOD with tile LOD which would depend on how densely packed the city is.

For example this could be a suggestion:
-it’s not shown at all from 0-9 tile LOD

-lowest model LOD is shown from tile LOD 10-12

-mid model LOD is shown from tile LOD 13-14

-highest LOD is shown from tile LOD 15 on up

Later on perhaps Cesium could auto adjust from the suggestion. When it senses that it’s being overloaded it could shift upward such as low model to 11-13, mid model to 14-15, high model 16+. Vice versa for when it senses it can handle all the models at a higher LOD.

I found this on GitHub regarding LOD and glTF


Hi Kevin,

This is very nice.

May I know what kind of data format you used for load the buildings? (e.g. they are individual GLTF model?) And how is the performance ? (like the total size and time to load, the FPS)

Thank you for sharing ~



The buildings are individual GLTF model. I had loaded more than 3,000 building models. The performance is satisfied when compared to GE . However, I wonder there are a amount limitation of loaded model in Cesium. So, maybe I need to destroy some loaded models when they are not in the view range?
Now I try to solve this problem for loading 400,000 building models using a Tile-like approach.

Do you check how much RAM the browser is using as you increase the number of buildings loaded? My first post to this forum was asking how to increase how much RAM the browser uses:

I’ve asked a similar question about Google Earth


Hi Kevin,

Awesome video! Individual glTF models is fine for a few thousand models. We are starting to look at a tiled LOD approach that will support the 400,000 building use case you mentioned.

Let’s continue the conversation in the new 3D models thread: https://groups.google.com/forum/#!topic/cesium-dev/IArj5ju4cI8