Possible depth test issue where globe renders over 3D tiles

204 views
Skip to first unread message

Adam Twite

unread,
May 16, 2019, 2:56:24 AM5/16/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.

We're having issues where 3D tiles that are on top of the globe are being clipped by it. It looks like it could be a depth test issue. If the camera is viewing the tiles from a certain distance then the tiles appear clipped. Attached a screenshot of what I mean. We've seen this on 3D tiles that are located in the USA. Tiles located in Australia seem fine.



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

We're using Cesium 1.57 on Mac and chrome. Although it looks like this problem exists on earlier versions of cesium too.

Screen Shot 2019-05-16 at 4.27.02 pm.png

Omar Shehata

unread,
May 16, 2019, 9:22:46 AM5/16/19
to cesium-dev
Can you try setting:

viewer.scene.globe.depthTestAgainstTerrain = true;

And let me know if that fixes the issue? if not, are you able to share your tileset in a Sandcastle for me to try it? If you can't share it publicly feel free to email me at om...@cesium.com
Message has been deleted

Adam Twite

unread,
May 16, 2019, 7:22:11 PM5/16/19
to cesium-dev
Thanks Omar, I've tried what you suggested and it does seem to fix the clipping issue. However the ground level of our terrain is slightly above the ground level of the 3D tiles, so it doesnt look right. Ideally we'd like to keep this property turned off.

I believe you already have our tileset for New York City. From this PR: https://github.com/AnalyticalGraphicsInc/cesium/pull/7774 it says you've done testing on Nearmap NYC. These tiles have the same issue when the camera is at grazing angles such as the screenshot I sent you.

Adam Twite

unread,
May 16, 2019, 11:46:32 PM5/16/19
to cesium-dev
We've done some more investigation and found that the problem is occurring in places where the 3D tiles are below the ellipsoid (without any terrain provider being used).

We are using the Cesium ION provider and the terrain geometry matches closely to our 3D tiles. If we disable the terrain provider then weve found that affected tilesets are always below the ellipsoid.


On Thursday, May 16, 2019 at 11:22:46 PM UTC+10, Omar Shehata wrote:

Omar Shehata

unread,
May 20, 2019, 7:03:15 PM5/20/19
to cesium-dev
Thanks for posting this additional information Adam. So just to confirm, is the terrain you're using itself below the ellipsoid in this location? 

I was going to suggest you can use the ion tileset location adjust tool to lift the tileset's height up, but it sounds like tileset being below the ellipsoid is correct here?

Adam Twite

unread,
May 20, 2019, 7:24:38 PM5/20/19
to cesium-dev
Thats right, both the terrain and the tileset should be below the the ellipsoid at these locations. These locations are at low elevations.

Omar Shehata

unread,
May 27, 2019, 6:06:52 PM5/27/19
to cesium-dev
I think I recently ran into this same issue on a different tileset. I believe the issue here is that the depth plane (which Cesium uses to prevent things on the other side of the globe from rendering when depthTestAgainstTerrain if off) is rendering slightly above the ellipsoid at certain angles. This can be confirmed either way by commenting out the two occurrences of depthPlane.execute in Scene.js:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Scene.js#L2479

I'll see if I can put together a reproducible Sandcastle with some open data and open a GitHub issue for this. 

Adam Twite

unread,
May 27, 2019, 8:36:01 PM5/27/19
to cesium-dev
We found a simple sandcastle program which reproduces the problem.

var viewer = new Cesium.Viewer('cesiumContainer', {
    terrainProvider: Cesium.createWorldTerrain()
});
viewer.scene.globe.depthTestAgainstTerrain = false;

var e = viewer.entities.add({
  position : Cesium.Cartesian3.fromDegrees(-117.145370, 32.643294 , -30),
  model : {
    uri : '../../../../Apps/SampleData/models/CesiumMan/Cesium_Man.glb',
    heightReference : Cesium.HeightReference.NONE,
    scale: 50
  }
});
viewer.trackedEntity = e;

Omar Shehata

unread,
May 29, 2019, 6:41:12 PM5/29/19
to cesium-dev
Thanks Adam, this is super helpful. I opened a bug report here:


We've identified the cause, which I described in more detail in the issue. Hopefully we'll get a chance to look into a fix soon.
Reply all
Reply to author
Forward
0 new messages