Interpolating textures?

I’m working on terrain for a project. I want to be able to have several layers of textures on the terrain at different locations.

( Eventually I want these locations to be edited in a map editor, but thats off topic for now )

The locations are decided based on the height of each polygon. Low polygon = sand; High Polygon = grass; I first lay out the entire terrain mesh and then split it into 2 display lists based on the layers. And apply different textures to them when they are drawn.

http://img253.imageshack.us/img253/5629/examplewz3.png

As you can see this leaves very noticeable borders.

How could I interpolate these textures as I can per-vertex colors. I see it done in games all the time.

http://www.bclhome.com/modeling/ut02.jpg

I don’t mind rewriting everything I have so far :slight_smile:

For the general approach :
http://delphi3d.net/articles/viewarticle.php?article=terraintex.htm
But beware, the extensions used in this tutorial/demo are really outdated.

They are replaced by much more generic GLSL stuff present in Opengl 2.0 :
http://www.lighthouse3d.com/opengl/glsl/index.php?textureMulti