You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this sandcastle the ground primitive is missing in 2D but visible in 3D.
2D
3D
The problem is that GroundPrimitive uses ApproximateTerrainHeights to determine the min/max height for the shadow volume even when terrain is off. The approximate min/max height for this location is
-0.000018664832009763883
275.13
In 2D the globe tiles themselves are exactly 0.0 which means the shadow volume should just barely covers the surface, but there's likely precision issues at play that cause the shadow volume to be slightly above the surface so that nothing gets rendered.
To confirm this suspicion I lowered the min height by -10.0 and the shadow volume shows up again. This is definitely not a recommended solution.
function setMinMaxTerrainHeights(primitive, rectangle, ellipsoid) {
var result = ApproximateTerrainHeights.getMinimumMaximumHeights(
rectangle,
ellipsoid
);
primitive._minTerrainHeight = result.minimumTerrainHeight - 10.0;
primitive._maxTerrainHeight = result.maximumTerrainHeight;
}
The only reason it works in 3D is because the globe triangles are not consistently at 0.0 height. If I raise the min height by 0.5 the shadow volume disappears.
The key point is that ApproximateTerrainHeights should not be used for ground primitives in 2D, or used at all (CC #8480)
The text was updated successfully, but these errors were encountered:
In this sandcastle the ground primitive is missing in 2D but visible in 3D.
The problem is that
GroundPrimitive
usesApproximateTerrainHeights
to determine the min/max height for the shadow volume even when terrain is off. The approximate min/max height for this location isIn 2D the globe tiles themselves are exactly
0.0
which means the shadow volume should just barely covers the surface, but there's likely precision issues at play that cause the shadow volume to be slightly above the surface so that nothing gets rendered.To confirm this suspicion I lowered the min height by
-10.0
and the shadow volume shows up again. This is definitely not a recommended solution.The only reason it works in 3D is because the globe triangles are not consistently at 0.0 height. If I raise the min height by
0.5
the shadow volume disappears.The key point is that
ApproximateTerrainHeights
should not be used for ground primitives in 2D, or used at all (CC #8480)The text was updated successfully, but these errors were encountered: