3D model texture not smooth

655 views
Skip to first unread message

sksu...@gmail.com

unread,
Apr 16, 2015, 11:48:58 PM4/16/15
to cesiu...@googlegroups.com
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

unread,
Apr 16, 2015, 11:55:55 PM4/16/15
to cesiu...@googlegroups.com, sksu...@gmail.com
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
https://drive.google.com/file/d/0BxNTH8gQ4iJ-eC1ITXptY2xGMlk/view?usp=sharing

near view
https://drive.google.com/file/d/0BxNTH8gQ4iJ-N0pyZk03eDVHRTg/view?usp=sharing

Hyper Sonic

unread,
Apr 17, 2015, 5:14:50 PM4/17/15
to cesiu...@googlegroups.com, sksu...@gmail.com
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?

Kevin Sun

unread,
Apr 18, 2015, 2:34:07 AM4/18/15
to Hyper Sonic, cesiu...@googlegroups.com
Thanks, Hyper Sonic

1. from texture.js, I guess the default sampling mode is bilinear.
       var minFilter = TextureMinificationFilter.LINEAR;
       var magFilter = TextureMagnificationFilter.LINEAR;
2. The models have't LoD levels.
3. 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? 

Hyper Sonic

unread,
Apr 18, 2015, 3:59:15 AM4/18/15
to cesiu...@googlegroups.com, gman...@gmail.com
Does setting viewer.scene.globe.maximumScreenSpaceError = 1; help by chance? Default is 2. It might not affect models though.

Kevin Sun

unread,
Apr 18, 2015, 5:11:10 AM4/18/15
to cesiu...@googlegroups.com, Hyper Sonic
Hi, Hyper Sonic

following your suggestion, I add viewer.scene.globe.maximumScreenSpaceError = 1; 
the result, as attached, have not improved.




2015-04-18 15:59 GMT+08:00 Hyper Sonic <gman...@gmail.com>:
Does setting viewer.scene.globe.maximumScreenSpaceError = 1; help by chance? Default is 2. It might not affect models though.

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/5E1zEuV5H0c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

error.jpg

Patrick Cozzi

unread,
Apr 18, 2015, 8:12:06 AM4/18/15
to cesiu...@googlegroups.com, gman...@gmail.com
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.

Patrick


On Saturday, April 18, 2015 at 5:11:10 AM UTC-4, Kevin Sun wrote:
Hi, Hyper Sonic

following your suggestion, I add viewer.scene.globe.maximumScreenSpaceError = 1; 
the result, as attached, have not improved.



2015-04-18 15:59 GMT+08:00 Hyper Sonic <gman...@gmail.com>:
Does setting viewer.scene.globe.maximumScreenSpaceError = 1; help by chance? Default is 2. It might not affect models though.

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/5E1zEuV5H0c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.

Kevin Sun

unread,
Apr 18, 2015, 11:29:39 AM4/18/15
to cesiu...@googlegroups.com, Hyper Sonic
Many thanks to Patrick & Hyper
The problem had solved.
I change the code in original COLLADA 
         <sampler2D>
            <source>XXX</source>
          </sampler2D>
 to
         <sampler2D>
            <source>XXX</source>
            <wrap_s>WRAP</wrap_s>
<wrap_t>WRAP</wrap_t>
<minfilter>LINEAR_MIPMAP_LINEAR</minfilter>
<magfilter>LINEAR</magfilter> 
          </sampler2D>

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.

B.R.

Kevin Sun

內置圖片 1

To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/5E1zEuV5H0c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.

Hyper Sonic

unread,
Apr 18, 2015, 1:00:44 PM4/18/15
to cesiu...@googlegroups.com, gman...@gmail.com
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.

Kevin Sun

unread,
Apr 18, 2015, 1:01:15 PM4/18/15
to cesiu...@googlegroups.com, Hyper Sonic
內置圖片 1

內置圖片 2


Patrick Cozzi

unread,
Apr 18, 2015, 7:06:25 PM4/18/15
to cesiu...@googlegroups.com, Hyper Sonic
Looks great Kevin!  When it is ready, can we showcase this app on the Cesium website: http://cesiumjs.org/demos.html

Thanks,
Patrick

On Sat, Apr 18, 2015 at 1:01 PM, Kevin Sun <sksu...@gmail.com> wrote:
內置圖片 1

內置圖片 2


--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/5E1zEuV5H0c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Sun

unread,
Apr 19, 2015, 10:14:34 PM4/19/15
to cesiu...@googlegroups.com, Hyper Sonic
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.  
 
2. 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

Hyper Sonic

unread,
Apr 20, 2015, 2:38:18 AM4/20/15
to cesiu...@googlegroups.com, gman...@gmail.com
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?

Kevin Sun

unread,
Apr 20, 2015, 4:59:24 AM4/20/15
to cesiu...@googlegroups.com, Hyper Sonic, pjc...@gmail.com
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.

Kevin


--

Hyper Sonic

unread,
Apr 20, 2015, 12:49:02 PM4/20/15
to cesiu...@googlegroups.com, pjc...@gmail.com, gman...@gmail.com
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

Narco

unread,
Apr 24, 2015, 3:56:25 AM4/24/15
to cesiu...@googlegroups.com, gman...@gmail.com
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 ~


Best,
Narco

Kevin Sun

unread,
Apr 24, 2015, 1:31:02 PM4/24/15
to cesiu...@googlegroups.com, Hyper Sonic
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.

Hyper Sonic

unread,
Apr 24, 2015, 2:25:47 PM4/24/15
to cesiu...@googlegroups.com, gman...@gmail.com
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

Patrick Cozzi

unread,
Apr 27, 2015, 6:15:12 PM4/27/15
to cesiu...@googlegroups.com, Hyper Sonic
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

Patrick

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/5E1zEuV5H0c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages