Reputation: 177
How can I stop this from happening? I have been looking at horizon culling but I am not sure if I am on the right tracks? Is there a simple few lines of code that will stop the application from showing the part of the shape that is underneath the globe?
Upvotes: 3
Views: 402
Reputation: 286
CentralBody
has a depthTestAgainstTerrain
property. Setting that to true will get you a lot closer to what you're after.
viewer.getPrimitives().getCentralBody().depthTestAgainstTerrain = true;
This is off by default because it can lead to artifacts. In particular, objects that are near the globe surface will sometimes be considered partially or fully underneath the surface due to limited depth buffer precision as well as changes in the shape of the surface at different levels of detail. We'll have a solution for this eventually, but it's a very difficult problem.
Upvotes: 4