Wall moves relative to ground

I simplified the standard wall sandcastle to this:

Here’s another example that maybe showcases the problem even better:

Answers:

  1. The Wall appears to move because the wall’s center point of below the terrain which creates a parallax effect. You can see when you turn don’t include the terrain layer that effect is not noticeable. The only reason you’re noticing it in your code sample is that the entirety of the wall is being rendered above the terrain surface.

  2. The Wall is being rendered above the wall because the scene’s globe is not set to perform depth testing against the terrain. Without turning on that setting any part of an entity or primitive that is positioned below the terrain, but above the ellipsoid “ground”, would be visible.

Very easy solution that worked great - thanks!