summaryrefslogtreecommitdiffstats
path: root/progs/glsl/multitex.frag
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-16 09:36:46 -0600
committerBrian Paul <[email protected]>2008-08-16 09:36:46 -0600
commitc0dd9122fdedd4bcab5bc0b3bbb490e6b62fac83 (patch)
treeac114b79c5790b10c0a8904ca79dfea5480c5617 /progs/glsl/multitex.frag
parentce00d232f3c01c71fb659568e9b58da1f24b2519 (diff)
remove .txt suffix from shader source files
Diffstat (limited to 'progs/glsl/multitex.frag')
-rw-r--r--progs/glsl/multitex.frag15
1 files changed, 15 insertions, 0 deletions
diff --git a/progs/glsl/multitex.frag b/progs/glsl/multitex.frag
new file mode 100644
index 00000000000..a2633ceba75
--- /dev/null
+++ b/progs/glsl/multitex.frag
@@ -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);
+ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
+ gl_FragColor = mix(t1, t2, t2.w);
+}