Contain mesh within another mesh boundaries? I'm trying to limit a mesh within certain boundaries so that I can then scale it really big and the mesh never goes out of boundaries of a box.  

I've tried using boolean but I get a plethora of strange artifacts. The mask modifier (as I understand it) only accounts same-mesh vertex groups. This wouldn't cut it, since when I scale the mesh I need the box to remain the same size.
I'm trying not to resort to hiding it via compositing, but if that's the only other way, I'll see what I can work around with that.

Do any of you know how can I achieve something like this?
Thanks in advance.
Consider scaling and translating your UV coordinates for a texture producing a displacement.