Water mask breaks custom material

Hey all,

I’m having an issues where I’d like to apply a custom material to the terrain in some cases only. I’d like to still use the water mask as it’s currently setup by default, but with the water mask enabled my custom material break. I’m using Cesium World Terrain with Sentinel-2.

The only thing you need to do to reproduce this is follow the steps here to create the red tint overlay, and turn on the water mask.

I can’t figure out exactly what’s going wrong. I’ve tried to mess around with the various blend modes and overlays but nothing works. It seems like any tile that’s close to water doesn’t show the tint at all, and the rest of the tiles show the tint but the material logic doesn’t quite work as expected for more complex materials.

Is this a known issue or am I doing something wrong?

Thank you!

Hi @flav, welcome to the community!

Which material slot are you using to set your custom material? There are several shown here:

The Water Material is used for tiles that contain the water mask. You’ll have to create a copy of the MI_CesiumThreeOverlaysAndClippingAndWater material instance, make your changes to that copy, and set it on the tileset. The water mask will already be applied for you in the material instance:

Let me know if that helps, or if you have any follow-up questions!

1 Like

Thank you janine! I didn’t realize you needed to swap to the water material slot when the mask was enabled. This works great.