3D Models are visible through terrain (moving from Google Earth to Cesiumjs)

Hi,

I have a vehicle that I can drive around the world, the camera is following that vehicle (keeping it always in view), and I have the terrain meshes loaded. The issue that I am experiencing is that if I am on one side of a hill and another vehicle (3D model) is on the other side of the hill, I can still see it through the terrain. The same happens for billboards and labels.

Is there a way to prevent this from happening?

Hi Andrew,

I would not expect this. Can you provide a screenshot?

Thanks,

Patrick

Check it out https://dl.dropboxusercontent.com/u/3050123/cesiumjs_terrain_issue.png

Hmm. I would not expect this. Can you send me

  1. a link to the app
  1. the glTF model

Thanks,

Patrick

You can access the app by going to https://youbeq.com (you have to register first in order to use it).
I just deployed the Cesium version today to the production server. I'm doing the first public testing (fingers crossed for no weird bugs appearing), and next week will start announcing the switch from GE to Cesium.

These are the links for the two planes in the picture:
https://youbeq.s3.amazonaws.com/ground_attack_new_aileron.gltf
https://youbeq.s3.amazonaws.com/express_plane_new.gltf

Thanks. Will have a look at the models.

From the view below, the depth test looks good. I’ll look into it more soon.

Patrick

No matter which 3D model I test there is always this issue. I will also do more testing in other browsers and computers.
Thanks for the help.

Andre,

Thanks for sharing the models and the link to your app. I’m having so much fun with it.

As for this issue, can you try setting this flag:

viewer.scene.globe.depthTestAgainstTerrain = true;

Looks like the base layer picker widget (which you are not using) sets this to true so I mistakenly thought the default was true.

Kevin - are we sure we want to expose this instead of just setting it based on the terrain provider? What is the use case? Work around artifacts in a particular app we built? Or perhaps we set this based on the terrain provider and an optional user override. Let’s discuss in #2160.

Patrick

Hi,

I'm glad you are having fun with it.
I just tested it and that solved the issue, don't know how I missed such an obvious flag.

Thanks for the help Patrick.

André

Awesome - I’m glad it worked for you. We are going to change the default to true so this should not be an issue for future developers.

Patrick

Did this change make it into the standard? I also remove the picker and had to set the property depthTestAgainstTerrain to true to not have my models being seen through terrain.

Hi @aslakjo,

Welcome to the community! :rocket: :grinning:

To the best of my knowledge, we have implemented the change that Patrick outlined in his most recent comment. For some more context, I recommend looking at the following two GitHub issues:

-Sam

1 Like