Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globe appearing underneath large polygons #10383

Closed
sanjeetsuhag opened this issue May 16, 2022 · 6 comments
Closed

Globe appearing underneath large polygons #10383

sanjeetsuhag opened this issue May 16, 2022 · 6 comments

Comments

@sanjeetsuhag
Copy link
Contributor

sanjeetsuhag commented May 16, 2022

This issue may be a subset of #4871, however, since there are multiple issues affecting large polygons - it may be helpful to break them up into smaller parts.

🟡 178Lon-Rhumb in this Sandcastle
Screen Shot 2022-05-11 at 10 11 18 AM

This band that appears is showing the near side of the globe

poly

@sanjeetsuhag
Copy link
Contributor Author

sanjeetsuhag commented May 16, 2022

Here's the bounding volumes for the example above:

View 1 View 2
image image

I think the bounding volumes may be playing a part here - even if they do not cause this particular rendering issue, they do seem problematic. For example, here's the rendering of the bounding volumes at certain scales:

62° Longitude Span 63° Longitude Span
works doesnt

@sanjeetsuhag
Copy link
Contributor Author

Another thing I noticed is the difference in the appearance of this "band" based on the longitudinal extent. In the examples below, there are two polygons: one of extent 179° and 181°. When the extent is >180°, the polygon wraps around the other side.

179° 181°
same opp

@sanjeetsuhag
Copy link
Contributor Author

sanjeetsuhag commented May 17, 2022

I forced the use of planar extents by editing the snippet below:

let usePlanarExtents = true;
for (i = 0; i < length; ++i) {
instance = instances[i];
geometry = instance.geometry;
rectangle = getRectangle(frameState, geometry);
if (ShadowVolumeAppearance.shouldUseSphericalCoordinates(rectangle)) {
usePlanarExtents = false;
break;
}

and achieved this result:

poly

@lilleyse I am unfamiliar with how shadow volumes work in CesiumJS - do you think that's the core problem here?

@sanjeetsuhag
Copy link
Contributor Author

A couple more findings using the presets in this local Sandcastle:

🟡 178Lon-Rhumb-Edge
bleed
🟡 178Lon-Rhumb-Precision
edge

Both of these seem to be influenced by the padding done in ShadowVolumeAppearance:

// Slightly pad extents to avoid floating point error when fragment culling at edges.
south -= CesiumMath.EPSILON5;
west -= CesiumMath.EPSILON5;
north += CesiumMath.EPSILON5;
east += CesiumMath.EPSILON5;

@ggetz
Copy link
Contributor

ggetz commented Jun 6, 2023

I think the bounding volume issue is documented in #7116.

@ggetz
Copy link
Contributor

ggetz commented Sep 22, 2023

And I think the rest of the issue is covered by #4746. Closing this as a duplcaite.

@ggetz ggetz closed this as completed Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Notable backlog items
Development

No branches or pull requests

2 participants