Original Post
Let me explain my scenario briefly.
Say you have an area of terrain that is completely flat and contains a single texture repeated across the terrain. Calculating the texture coordinates is a simple process of using the (x, y) coordinates of the terrain (we''re assuming here that z is UP towards the sky). This same process of assigning texture coordinates based on (x, y) can be used if there are varying heights across the terrain. However, this will result in steep triangles that have a stretched texture due to not taking the height into account.
If the height is taken into account, though, the texture will avoid the stretching problem but will end up not aligning with eachother. This can be explained if you follow a texture over a steep hill which has a total "x-texture-distance" of 160. Whereas if you simply follow along the bottom of the hill, the "x-texture-distance" could be a much smaller value of 100 or so. End result? Texture coordinates don''t line up.
Does anyone know of a way to maintain texture coordinates that take into account height and align evenly across a terrain?