1// Multi-texture fragment shader 2// Brian Paul 3 4// Composite second texture over first. 5// We're assuming the 2nd texture has a meaningful alpha channel. 6 7uniform sampler2D tex1; 8uniform sampler2D tex2; 9 10void main() 11{ 12 vec4 t1 = texture2D(tex1, gl_Color.xy); 13 vec4 t2 = texture2D(tex2, gl_Color.yz); 14 gl_FragColor = mix(t1, t2, t2.w); 15} 16