2008-05-20 18:01:17 +01:00
|
|
|
// Multi-texture fragment shader
|
|
|
|
// Brian Paul
|
|
|
|
|
|
|
|
// Composite second texture over first.
|
|
|
|
// We're assuming the 2nd texture has a meaningful alpha channel.
|
|
|
|
|
|
|
|
uniform sampler2D tex1;
|
|
|
|
uniform sampler2D tex2;
|
|
|
|
|
2008-11-10 17:21:13 +00:00
|
|
|
void main()
|
2008-05-20 18:01:17 +01:00
|
|
|
{
|
2008-08-15 18:49:05 +01:00
|
|
|
vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
|
2008-11-10 17:21:13 +00:00
|
|
|
vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
|
2008-05-20 18:01:17 +01:00
|
|
|
gl_FragColor = mix(t1, t2, t2.w);
|
|
|
|
}
|