How to use a stencil material

I’m making a game with a boat. Sometimes the bottom of the boat is under the level of the water, as so the water can be seen at the bottom. I’m using the standard Unreal water simulation. (Not shallow water.)

Now, this question has been asked and answered. An answer that looks useful is this one: Hiding water surface inside a boat - World Creation - Epic Developer Community Forums

But I’m really not a graphics or shader person. I’ve followed all the instructions. I made the material and the material function described at the end.

But I don’t know what to do with them. I’ve tried applying the material to the water “post processing” material. Same for the boat, and it didn’t change anything.

Where am I supposed to place this material.

I sort of understand how it works: it says that the object it is applied to has special rules, in this case, its ability to “cut” like a stencil inside anther object’s rendering. That would seem to indicate that it should go somewhere on the boat. But I just don’t know where.

And how about the material function? Am I supposed to use both the material and the material function? If so, again, where do they go? I tried what the page says: add the material function to an existing material, but I’ve found no material currently in use that can be modified that way.

I’m lost. What can I do?