Editing water mask of cesium world terrain

Hello,

I’m trying to create an underwater scene with Cesium for Unreal, currently what I’m doing is I have both the Cesium bathymetry terrain for the underwater terrain, as well as the Cesium world terrain for the ocean surface, and I’m combining both of them to create the overall underwater scene.
The water mask of the ocean surface looks fine when viewed from above like so:


But when viewed from underwater it looks like this:

What would be the best way to fix it so the water surface looks the same as above from below. What I’m thinking is that I create a new ocean surface material for the watermask and then change it so it shows the same thing from both sides. But I just want to get thoughts if there is any other way while keeping the look of the watermask from cesium world terrain.

Thanks!

Hi @goku,

Just for context, what’s the use case for using Cesium World Terrain as a water layer? Does anything prevent you from using the built-in Unreal water bodies, like these?

I can suggest making the material for terrain double-sided, so that tiles draw whether you’re above or below them. But my concern is: the lines that you see in the second picture are the “skirts” of the tiles. They’re automatically generated for terrain to prevent cracks from showing between tiles. The solution I want to suggest won’t prevent these from showing, so I wonder if you can find a better solution with a standard Unreal water body.

If not, though, then my suggestion is to create a copy of the Unreal material and set its “Two Sided” property to true:

Let me know if that works for you!

1 Like

Hi Janine,

I’m new to Unreal with Cesium so I was just trying things that might work. I haven’t thought about using water bodies yet, but it seems like it would be the way to go with what I’m working on. Could you point me to the right direction on how I could use the water body to create the ocean surface on top of the Cesium bathymetry terrain? My main concern is getting the surface to follow the spherical nature of the earth rather than treating it like a flat plane.

Thanks for the help!

Hi @goku, I’m so sorry I missed this. Thank you for your patience.

I took some time to try and get this working, and it’s possible in theory. I use a Water Body Custom and override the mesh with the built-in “Sphere” mesh.

With that, you have a spherical body of water.

The hard part comes from trying to align this sphere with the Earth. For one, the Earth is an ellipsoid (not a perfect sphere), so you’d need to align it for the dimensions each axis. And you have to make sure that the sphere is located at the center of the Earth. I tried to ensure this by attaching a CesiumGlobeAnchor component.

Unfortunately, the Sphere mesh that Unreal provides is really low resolution, so it doesn’t look very good. But in theory if you had a high poly sphere mesh, this could look good.

You may have already moved on from this issue, and if so I apologize profusely for the delay. But I hope this gives some starting direction for any future endeavors.

1 Like