How to make terrain deformation not effect tiling

What I am trying to say is that I want to control the uv layout of the terrain mesh, because when I deform the terrain it stretches the textures out. How do I get the texture to tile consistently and be independent of the topology of the terrain mesh. I want it to be tiled in world space I guess.