Hello all, I am trying to fetch the depth texture of the Cesium scene and use it in other engines like Three.js or Babylon.js.
I did not find a straightforward way. Currently, I am using viewer.scene.context.uniformState.globeDepthTexture to obtain a WebGLTexture.
However, I noticed that the depth value of this texture jitters a lot when the camera is moving. If I add OSM Buildings into the scene, then the depth value looks smooth and correct.
So my question is, how can I properly obtain the depth texture (as a WebGLTexture) and avoid the dependency on OSM Buildings?
Not yet. Are you having the exact same issue as me? That is, the depth texture values undergo significant changes at times when the camera undergoes slight rotations?
The reason the depth texture looks jittery a lot is that Cesium is updating the camera frustum (near/far) dynamically when the camera is moving. So to get the depth value within a fixed range distribution, you need to manually normalize the value with the real-time near and far values from: