To provide some context, I’m trying to recreate a bird’s-eye view of an aviation GPS. To do this, I need the Earth (hence the use of cesium) as well as a material that changes color based on altitude (green at low altitudes, brown >1000m, dark brown > 2000m). This is just an example; I need a simplified view (without details or cities). But I still have a problem: how do I handle the water? Setting blue at 0 meters altitude could be a solution, but that’s not what I’m looking for. For that, I’d like to use Cesium’s water mask to color areas where the mask value is 1 with a blue material. But I really don’t know how to go about it due to my lack of knowledge of Cesium. could you please help me?
By the way, I have a quick update: I managed to find the water mask and make it work, but if I don’t use satellite view, I run into issues with material collisions.
I have absolutely no idea how I could smooth out the connection points between the two, or how to avoid this area where no material is assigned.
Hey @Rxmex,
Welcome to the forum! Nice work getting the water mask up and running! The boundary issue you’re describing is pretty common when mixing a custom material with Cesium’s water mask system.
I think what’s happening is that the altitude material and the water material are operating as two separate systems, which creates those unassigned gaps at coastlines and messy borders between the two. The cleaner fix is to integrate both into a single material using Cesium’s material layering system.
The tileset actor has three material slots: Material, Translucent Material, and Water Material. You should be able to point all three to the same custom material instance for seamless rendering.
@pjiang9 walked through this workflow recently in Change Water color in cesium water material. Related threads: Custom water mask and Rendering the water using ue4.
Let me know if this helped! The aviation GPS use case sounds interesting.
Cheers!
Quick follow-up on this, I’d recommend checking out the Cesium for Unreal Samples project, specifically Level 9. It has pre-built materials for custom water masks, elevation band coloring and height blending, which sounds like basically exactly what you’re building. Might save you a lot of graph wiring!
