How to apply UV maps to terrain?

I’m new to Unity, but I’ve done game programming in C++ for quite some time using various lower-level engines. My first game in Unity is utilizing procedurally generated terrain, and I’m having trouble texturing it the way I would like to. I’ve got a couple textures which can be broken down into tiles, and I’d like to give UV coordinates to each triangle in the terrain in order to create a tiled texture maps. This effect is important to the visual style of my game, and I’d like to avoid overlapping textures, like those created by “splat maps.” This seems like a fairly straightforward operation, but I still seem to be having trouble locating the Unity API documentation describing how to do this. I expect I’m missing something, and would like some advice in how to achieve tile-mapped terrain.


I believe you can achieve this effect with the shader code found at this link.

  1. Create a new shader file and copy-paste the script into it.
  2. Create a new material and select your new shader from the material preferences
  3. Apply the desired texture to the material.
  4. Apply material to terrain or tile object.

Additionally, if you figure out how to add code to the shader to include things like bump maps, I’d like to know.

I found a really good package on the asset store called PATileTerrain that accomplishes this task quite nicely.