Cesium: Globe incorrectly occludes things behind it when using smaller ellipsoid

Created on 16 Mar 2020  路  10Comments  路  Source: CesiumGS/cesium

When using a smaller Ellipsoid, the globe incorrectly occludes entities behind it. Sandcastle example.

It almost seems like there's a rectangle around the globe that occludes entities behind it:

occlusion

The effect disappears if you set the radius up to Earth-size (comment out the second line in the Sandcastle).

This came up in this forum thread where the use case was visualizing different planets.

type - bug

All 10 comments

It's definitely coming from the globe, since removing the globe entirely (with globe: false) fixes it. But setting viewer.scene.globe.show = false does not fix it.

Maybe depth plane related? What happens if this line is commented out:

https://github.com/CesiumGS/cesium/blob/d48ac3ee47fd77c9f27297b833cbe88dd5aebfcc/Source/Scene/Scene.js#L2310

That sounds right, commenting that out makes nothing be occluded here:

image

It looks like DepthPlane.js is getting the ellipsoid from frameState.mapProjection.ellipsoid, but for whatever reason it's producing this incorrect approximation for smaller ellipsoids?

The problem is czm_ellipsoidInverseRadii is hardcoded to WGS84. DepthPlaneFS.glsl uses it. Instead czm_ellipsoidInverseRadii should be based on the actual ellipsoid in use.

Same with czm_ellipsoidRadii. They should both be added to AutomaticUniforms instead of hardcoded.

Also, if you really want to modify the ellipsoid in Cesium, you are probably better off doing:

Cesium.Ellipsoid.WGS84 = new Cesium.Ellipsoid(radius, radius, radius);

before you do anything Cesium related. That's currently the only way to ensure that all data and calculations actually use the custom ellipsoid (such as loading entities that require ellipsoid-based conversions).

Thanks @mramato . That was the first thing I tried here. I added a link to the the forum discussion where this came up in the OP.

Here's an example: https://sandcastle.cesium.com/index.html#c=jVLbjpswEP0Vi5cQKTJptVK7CRs1Squ8bNWuUNsXXgY8AXeNB/lClK367zUh6S57axESjM85M8cz04FhBoT0ll2xtxeX7+bz+TLXG7TSN/yTUrK1JAX/sc3eXwSKxj17DMZDghkbf6chT667UKCTuEczVn8/nsWT8hhuSDuQGs1kxn7lmoXH1uSVWGvZgEO2YDtQFmcn7Pawdg3ZtkaDY6iB9quhn1g6SXrxsOIWqTLQ1rK8J8TTXP8ejGagRQnWKeQGLbpgd+f1iXU2NdyEC3CQkTfBPAch4lOFzV2jPv6FuCIQ8YTzJLwZNK3CHkys7H95GciT6VB7lNyWqJFXigrkqKFQeC2r2kld9Zb6qy5f5Iem7beGvBb3/fm3qgCLG1LUj+h8lT7k65tv6+Wz9nZUncyJ1/I3RPpo6jWS9f/BqUHQ/jO0z1QNI1xGsyi17qBwNYg/hCaTccwbFYf2Oww9D3tkk8KXt+h4aY/7mSZnUSpkx6S4yqNHG5lHrFRgbUB2XqlM3mEerdIk8EeyftphRl86NAoOPaV+s7oeDjnnaRLCpypHpAowDzL+AQ

EDIT: In the original post, PA is floating, in this one it's properly on the ellipsoid

@OmarShehata I'll submit a PR with the czm_ellipsoidRadii / czm_ellipsoidInverseRadii fix

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/forum/#!topic/cesium-dev/pDezVst5b_I

If this issue affects any of these threads, please post a comment like the following:

The issue at https://github.com/CesiumGS/cesium/issues/8683 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.

Was this page helpful?
0 / 5 - 0 ratings