summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-02-02 20:20:11 +0000
committerKeith Whitwell <[email protected]>2010-02-03 10:36:55 +0000
commit9f1ee5a864a3e0ede5aa04d6316e97dc94f01fe8 (patch)
tree87c66fb425ba9ea1ffacc43ad3c94238741f0254
parentd7b1610cedbd8139bdecd41556094832b1dd1e6f (diff)
progs/fpglsl: couple more tests
-rw-r--r--progs/fpglsl/tex-multi.glsl15
-rw-r--r--progs/fpglsl/tex.glsl6
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 00000000000..5220b7efaf2
--- /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 00000000000..4302fabe2d5
--- /dev/null
+++ b/progs/fpglsl/tex.glsl
@@ -0,0 +1,6 @@
+uniform sampler2D tex1;
+
+void main()
+{
+ gl_FragColor = texture2D(tex1, gl_Color.xy);
+}