Mesa (master): progs/fpglsl: couple more tests

Keith Whitwell keithw at kemper.freedesktop.org
Wed Feb 3 10:41:16 UTC 2010


Module: Mesa
Branch: master
Commit: 9f1ee5a864a3e0ede5aa04d6316e97dc94f01fe8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f1ee5a864a3e0ede5aa04d6316e97dc94f01fe8

Author: Keith Whitwell <keithw at vmware.com>
Date:   Tue Feb  2 20:20:11 2010 +0000

progs/fpglsl: couple more tests

---

 progs/fpglsl/tex-multi.glsl |   15 +++++++++++++++
 progs/fpglsl/tex.glsl       |    6 ++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

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




More information about the mesa-commit mailing list