Dynamically texture a plane at runtime.

Hi.

What is the best way to programmaticly texture a plane (based on height of vertex, neighbours, and so on)? Just to clearify, I want to have different textures on different parts of the same plane.
Ive tried using a texture atlas and setting UV coordinates depending on which texture should be where, but is that really the best way? Is there some way to “paint” with multiple textures on a plane?

Also, how can I control how the blending between different textured areas of the plane looks?
(As ive asked in this question.)

Im at a loss here.

Thanks!

K.

Search for splatmap shaders,
basic idea here,

but most likely you get better results by using splatmap mask texture
(so it takes correct texture based on the splatmask colors)

as in these images:

Thanks, i’ll take a look at it.

What about the texture blending (as in the question linked in from unity answers) and an uneven border around a texture “area”?