progs/fpglsl: couple more tests
authorKeith Whitwell <keithw@vmware.com>
Tue, 2 Feb 2010 20:20:11 +0000 (20:20 +0000)
committerKeith Whitwell <keithw@vmware.com>
Wed, 3 Feb 2010 10:36:55 +0000 (10:36 +0000)
progs/fpglsl/tex-multi.glsl [new file with mode: 0644]
progs/fpglsl/tex.glsl [new file with mode: 0644]

diff --git a/progs/fpglsl/tex-multi.glsl b/progs/fpglsl/tex-multi.glsl
new file mode 100644 (file)
index 0000000..5220b7e
--- /dev/null
@@ -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_Color.xy);
+   vec4 t2 = texture2D(tex2, gl_Color.yz);
+   gl_FragColor = mix(t1, t2, t2.w);
+}
diff --git a/progs/fpglsl/tex.glsl b/progs/fpglsl/tex.glsl
new file mode 100644 (file)
index 0000000..4302fab
--- /dev/null
@@ -0,0 +1,6 @@
+uniform sampler2D tex1;
+
+void main()
+{
+   gl_FragColor = texture2D(tex1, gl_Color.xy);
+}