I am however struggling with the mask side of things. I’ve had a bit of a play with the MF_CesiumWaterMaskSample but trying to tweak the output to anything other than what’s provided seems to result in an entirely grey texture.
Are you using the latest version of Cesium for Unreal (v1.28.0)? This sounds like a bug we had once, but it was quite awhile ago.
I would be really grateful if you could give me a few more pointers as to where I should be digging / if I’m on the right lines.
Start by copying
MI_CesiumThreeOverlaysAndClippingAndWater and editing the copy. On the “Material Parameters” tab, notice that there’s a layer named “Water” and three others labeled “Overlay0”, “Overlay1”, and “Overlay2”. You basically need to combine elements of Water and one of the elements.
First, change the “Layer Asset” in the “Water” layer from
ML_CesiumRasterOverlay. Then rename the Water layer to something else, like
MyWater. Back in your level, add a Cesium ion Raster Overlay for your water mask, and set its Material Layer Key to the same name you renamed the water layer in the material to (
MyWater). Select your new material instance for all three materials on the tileset (Material, Translucent Material, and Water Material).
Try it out. You might get something useful, or you might not. If it’s not quite right, the next step is to copy the “Blend Asset” used in the water layer in your material instance (
MLB_CesiumSimpleWater), select the copy in your material instance, and modify it as necessary.
MLB_CesiumSimpleWater, there’s a a
GetMaterialAttributes node that gets the pixel value from the raster overlay, which in this case is your water mask. You need to turn that pixel value into the correct input to the
ML_CesiumLandWaterBlend function. You want to pass a value of 1.0 where there is water, and 0.0 where there is land. So do whatever manipulations you need to do to the pixel color values from the mask geotiff to make that happen.
On an additional note - I’m currently only using one geotiff for my mask. I suspect I will need several along the coastline. Can I zip these up or similar and upload to Cesium as a collection/single asset to be used as a single raster overlay?
Yep, you can upload multiple GeoTIFFs to make a single imagery tileset. No need to ZIP, just select all the files when you upload to Cesium ion.