   Texture coords for a deformed flat surface
  My heightmapped engine currently chooses texture coords for the ground vertices based just on x/z data - no height. So if there''s a steep slope it gets stetched and horrible. What kind of ideas are there to get the texture ''skinned'' over the landscape but mathing ok at the boundaries of polygons? 
  Use the deformed surface''s normals as offsets to the texture coordinates.Note that this works only on relatively simple geometry (no overlapping). Also, you need to scale the normals for them to be useful in offsetting the texture coords; the theoretical "correct" scale is the dot product of the normal against "up" axis.For more advanced mapping, see "face walking" or something like that in google -Nik ;  What I do is this... for u coords.. I walk each line across the map in one axis.. and keep the total distance walked accounting for height variation (using pythagoras on all the triangles). I then place the texture coordinates based on a running distance count so that they are distributed according to the actual distance travelled between them. I do this for each row for u coords.. then for each column for v coords. I hope you understand what I mean... but in general it is very simple. If you want very specific control over what bit of texture goes where.. what you can do.. is draw a texture at very highres (say 4x the required size in each direction) then map it onto the actual texture you are using vertically... bilinearly interpolating the texture values between the verticies. It has to be at considerably larger.. otherwise you will simply reintroduce the problem you had in the first place on steep slopes. Alternatively.. you can provide some mechanism to paint directly onto the mesh with your auto generated texture coordinates. This is ideal, as you take maximum advantage of the resolution available (though the other method may be easier). ;  I''ve a feeling I tried your 1st idea and had problems. I''ll try it agian and make sure though. 