How to not draw a surface if a certain other surface is behind it
This is a super specific (and kind of strange) one, and I more than half expect I'm going in the wrong direction and am totally open to other directions. What I'm ultimately trying to do is have water, have things floating partially submerged in that water, and having the water not fill floating objects (ie: the way it might if the object were simply intersecting the surface.)
I have a general model in mind, that the water's surface can be modeled as a plane, I've seen a bunch of different approaches for applying buoyancy to objects intersecting (or below) the plane, and expect a shader can be used to give the plane a shimmering/watery effect, post processing effects can do something similar for a camera submerged in the water, etc. Cool.
However, when inside another object, like the inside of a ship, I don't want any of this to happen. Most of it follows logically - the inside of the ship could have a trigger collider that indicates to objects that they shouldn't do any water behaviors (floating, underwater vision, etc), but I don't know how to not draw the water's surface through the object. I'm thinking I need a way to punch a hole in it, or possibly for the shader that distorts the water's surface to also make it transparent if certain faces are on the other side, but I don't know how any of this would work or if there might be something super simple and integrated into the engine that could be used for this purpose (something around culling perhaps?)
Thoughts/suggestions?
Your answer