I have created a tileset of quantized-mesh terrain, in which I have added water masks according to the specification. However, in Unreal Engine 5 with a Cesium 3D Tileset, tiles are either rendered as all-water or all-land. This is expected for tiles where the mask is just 1 byte, but for those where the mask is 256*256 bytes, I would expect the water material to render only some portions of the tile as water (following the values of the mask). I am using the default MI_CesiumThreeOverlaysAndClippingAndWater material for water.
Is the linked specification up to date? How can I make Cesium for Unreal render only portions of the tile as water?
Yes that spec should be accurate. Is Cesium World Terrain working as expected for you? If so, take a working Cesium3DTileset and change just its URL to point your tileset. Don’t change the materials or any other settings.
If that still doesn’t work, check if your tileset works in CesiumJS. If it works there but not in Cesium for Unreal, please send me a small terrain that has the problem, and I’ll take a look.
If it doesn’t work there, either, I suggest stepping through the water mask loading code in either CesiumJS or Cesium for Unreal (both are open source) and see where it’s getting tripped up by your tiles.
Cesium World Terrain works as expected for me, and changing the URL to point to my tileset did indeed solve the issue!
This made me wonder what exactly the issue was. I created a “Cesium World Terrain + Bing Maps Aerial Imagery”, then enabled the water mask. This made the water mask render correctly (see image below).
Then I deleted the “Bing Maps Aerial” component from the actor, and clicked the “Refresh Tileset” button in the “Cesium World Terrain” actor. And there is the problem again, water masks are no longer considered (see image below, which corresponds to the same view as the image above).
The underlying problem seems to be that the default material does not render water masks correctly when there is no raster overlay attached to the actor. Is there any easy fix to this? We’re not planning on using any textures on terrain.
In case anyone else runs into this problem, I found a workaround. By simply adding a CesiumDebugColorizeTilesRasterOverlay, the water masks will behave as expected. Any Raster Overlay would do, but I found this to be the simplest one available, and it works offline.