Fluid surface open boundary

I’m making some good progress on a fluid surface effect, using a combination of the fluid surface from Content Examples and a free project I found via a showcase on YouTube. The effect is now pretty much exactly as I want, but I’m currently stuck with the “boundary” of the surface.

Basically, when the fluid simulation grabs the previous and next UV coordinate/texel (as it does in Content Examples), it doesn’t check whether it’s a boundary coordinate (the first and last U and V coordinates along the edge of the render target). So when it tries to grab the adjacent coordinate, it either wraps around or mirrors the RT (depending on whether the render targets are set to “Wrap” or “Clamp”). What I need is an “open boundary” so the waves seem to go beyond the edge and disappear.

I roughly know the formula to determine the boundary values, but I don’t know how to modify the heightfield sim material to get it to work. The material is identical to the one in Content Examples.