How to realize the effect of Underground Mode in Cesium Development
This article mainly shows you "how to achieve underground mode effect in Cesium development". The content is simple and easy to understand and clearly organized. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "how to achieve underground mode effect in Cesium development".
After modifying the source code, when executing underground mode, set the background color of the map, synchronize the translucent operation of the map image, and refresh the image layer to display the effect in time.// Set map basecolor to transparent
viewer.scene.globe.baseColor = new Cesium.Color(1, 1, 1, 0);/ /Cycle to set transparency of image
var _mapAlpha = 0.5;
if (viewer.imageryLayers) {
for (var i = 0; i < viewer.imageryLayers.length; i++) {
viewer.imageryLayers.get(i).alpha = _mapAlpha;
}
}
//Refresh all image slices
viewer.scene.globe._ surface.invalidateAllTiles();
Transparent surface effect, showing half above ground and underground
In the above image, the transparency of underground mode is realized, but there is still a shadow floating underground. This is Cesium's own atmospheric effect. If you need to turn it off, this effect will not exist. viewer.scene.skyAtmosphere.show = false;
There is no problem with black shadows in the above image. The whole scene has turned black. Therefore, when using the map, the dark base image will appear very dark and the specific effect cannot be seen clearly. The above is all the content of this article "How to realize underground mode effect in Cesium development", thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!