Read the shader workshops: http://www.conitec.net/shaders/
After you are done with them (!) just take the diffuse shader as a basis and transform it into a multitex terrain shader yourself. Use "lerp" to blend between different textures (multiple tex2D calls from different texture samplers) based on some kind of blendmap information but multiply the textures/ colors with detail map colors first (where you scale InTex with some variables/ vecSkills, like Mr. Lotter said).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends