diff options
Diffstat (limited to 'progs/glsl/multitex.frag.txt')
-rw-r--r-- | progs/glsl/multitex.frag.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/progs/glsl/multitex.frag.txt b/progs/glsl/multitex.frag.txt new file mode 100644 index 00000000000..86045306af2 --- /dev/null +++ b/progs/glsl/multitex.frag.txt @@ -0,0 +1,15 @@ +// 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; + +void main() +{ + vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy, 0.0); + vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy, 0.0); + gl_FragColor = mix(t1, t2, t2.w); +} |