I almost got it to work now, but i have a strange error.
I can mix 2 textures and everything works fine.
As soon as i mix the third texture, the rest of the scene (plants etc) gets messed up, while terrain is fine. All the other Textures then get replaced by the alphamap
Looks like this:
Shader:
uniform sampler2D Alpha;
uniform sampler2D Forest;
uniform sampler2D Grass;
uniform sampler2D Rock;
void main(void){
vec4 alpha = texture2D(Alpha, gl_TexCoord[0].xy);
vec4 tex0 = texture2D(Forest, gl_TexCoord[1].xy);
vec4 tex1 = texture2D(Grass, gl_TexCoord[1].xy);
vec4 tex2 = texture2D(Rock, gl_TexCoord[1].xy);
tex0 *= alpha.r;
tex1 = mix(tex0, tex1, alpha.g);
vec4 outColor = mix(tex1, tex2, alpha.b);
gl_FragColor = outColor;
}
Anybody knows some help?
/edit: working now, just some multitexturing issue...