summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-05-17 20:37:43 -0700
committerEric Anholt <eric@anholt.net>2011-05-17 20:37:43 -0700
commit47d17c6674a16ad96a755967af06a8b7c979514e (patch)
tree95181577e4e5504a96e63243199a024b38b40c3b /shaders
parentd0bcb6cca5b0238f79285f19901ad06af9500d35 (diff)
shaders/cairo-gl: Initial import.
Diffstat (limited to 'shaders')
-rw-r--r--shaders/cairo-gl/1.frag6
-rw-r--r--shaders/cairo-gl/1.vert10
-rw-r--r--shaders/cairo-gl/10.frag16
-rw-r--r--shaders/cairo-gl/2.frag17
-rw-r--r--shaders/cairo-gl/2.vert14
-rw-r--r--shaders/cairo-gl/3.frag15
-rw-r--r--shaders/cairo-gl/3.vert12
-rw-r--r--shaders/cairo-gl/4.frag16
-rw-r--r--shaders/cairo-gl/4.vert12
-rw-r--r--shaders/cairo-gl/5.frag16
-rw-r--r--shaders/cairo-gl/5.vert12
-rw-r--r--shaders/cairo-gl/6.frag16
-rw-r--r--shaders/cairo-gl/7.frag16
-rw-r--r--shaders/cairo-gl/8.frag14
-rw-r--r--shaders/cairo-gl/9.frag15
15 files changed, 207 insertions, 0 deletions
diff --git a/shaders/cairo-gl/1.frag b/shaders/cairo-gl/1.frag
new file mode 100644
index 0000000..41c7e35
--- /dev/null
+++ b/shaders/cairo-gl/1.frag
@@ -0,0 +1,6 @@
+uniform vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+
diff --git a/shaders/cairo-gl/1.vert b/shaders/cairo-gl/1.vert
new file mode 100644
index 0000000..03b57f1
--- /dev/null
+++ b/shaders/cairo-gl/1.vert
@@ -0,0 +1,10 @@
+attribute vec4 Vertex;
+attribute vec4 Color;
+attribute vec4 MultiTexCoord0;
+attribute vec4 MultiTexCoord1;
+uniform mat4 ModelViewProjectionMatrix;
+void main()
+{
+ gl_Position = ModelViewProjectionMatrix * Vertex;
+}
+
diff --git a/shaders/cairo-gl/10.frag b/shaders/cairo-gl/10.frag
new file mode 100644
index 0000000..b35f011
--- /dev/null
+++ b/shaders/cairo-gl/10.frag
@@ -0,0 +1,16 @@
+varying vec2 source_texcoords;
+uniform sampler1D source_sampler;
+
+vec4 get_source()
+{
+ return texture1D (source_sampler, source_texcoords.x);
+}
+vec4 get_mask()
+{
+ return vec4 (0, 0, 0, 1);
+}
+void main()
+{
+ gl_FragColor = get_source() * get_mask().a;
+}
+
diff --git a/shaders/cairo-gl/2.frag b/shaders/cairo-gl/2.frag
new file mode 100644
index 0000000..3a19bd5
--- /dev/null
+++ b/shaders/cairo-gl/2.frag
@@ -0,0 +1,17 @@
+varying vec2 source_texcoords;
+uniform sampler1D source_sampler;
+
+vec4 get_source()
+{
+ return texture1D (source_sampler, source_texcoords.x);
+}
+varying float mask_coverage;
+vec4 get_mask()
+{
+ return vec4(0, 0, 0, mask_coverage);
+}
+void main()
+{
+ gl_FragColor = get_source() * get_mask().a;
+}
+
diff --git a/shaders/cairo-gl/2.vert b/shaders/cairo-gl/2.vert
new file mode 100644
index 0000000..7fafc49
--- /dev/null
+++ b/shaders/cairo-gl/2.vert
@@ -0,0 +1,14 @@
+varying vec2 source_texcoords;
+varying float mask_coverage;
+attribute vec4 Vertex;
+attribute vec4 Color;
+attribute vec4 MultiTexCoord0;
+attribute vec4 MultiTexCoord1;
+uniform mat4 ModelViewProjectionMatrix;
+void main()
+{
+ gl_Position = ModelViewProjectionMatrix * Vertex;
+ source_texcoords = MultiTexCoord0.xy;
+ mask_coverage = Color.a;
+}
+
diff --git a/shaders/cairo-gl/3.frag b/shaders/cairo-gl/3.frag
new file mode 100644
index 0000000..ca1bb2d
--- /dev/null
+++ b/shaders/cairo-gl/3.frag
@@ -0,0 +1,15 @@
+uniform vec4 source_constant;
+vec4 get_source()
+{
+ return source_constant;
+}
+varying float mask_coverage;
+vec4 get_mask()
+{
+ return vec4(0, 0, 0, mask_coverage);
+}
+void main()
+{
+ gl_FragColor = get_source() * get_mask().a;
+}
+
diff --git a/shaders/cairo-gl/3.vert b/shaders/cairo-gl/3.vert
new file mode 100644
index 0000000..1dfce8d
--- /dev/null
+++ b/shaders/cairo-gl/3.vert
@@ -0,0 +1,12 @@
+varying float mask_coverage;
+attribute vec4 Vertex;
+attribute vec4 Color;
+attribute vec4 MultiTexCoord0;
+attribute vec4 MultiTexCoord1;
+uniform mat4 ModelViewProjectionMatrix;
+void main()
+{
+ gl_Position = ModelViewProjectionMatrix * Vertex;
+ mask_coverage = Color.a;
+}
+
diff --git a/shaders/cairo-gl/4.frag b/shaders/cairo-gl/4.frag
new file mode 100644
index 0000000..e5cd0a3
--- /dev/null
+++ b/shaders/cairo-gl/4.frag
@@ -0,0 +1,16 @@
+uniform vec4 source_constant;
+vec4 get_source()
+{
+ return source_constant;
+}
+uniform sampler2D mask_sampler;
+varying vec2 mask_texcoords;
+vec4 get_mask()
+{
+ return texture2D(mask_sampler, mask_texcoords);
+}
+void main()
+{
+ gl_FragColor = get_source() * get_mask().a;
+}
+
diff --git a/shaders/cairo-gl/4.vert b/shaders/cairo-gl/4.vert
new file mode 100644
index 0000000..e2c73d4
--- /dev/null
+++ b/shaders/cairo-gl/4.vert
@@ -0,0 +1,12 @@
+varying vec2 mask_texcoords;
+attribute vec4 Vertex;
+attribute vec4 Color;
+attribute vec4 MultiTexCoord0;
+attribute vec4 MultiTexCoord1;
+uniform mat4 ModelViewProjectionMatrix;
+void main()
+{
+ gl_Position = ModelViewProjectionMatrix * Vertex;
+ mask_texcoords = MultiTexCoord1.xy;
+}
+
diff --git a/shaders/cairo-gl/5.frag b/shaders/cairo-gl/5.frag
new file mode 100644
index 0000000..b233478
--- /dev/null
+++ b/shaders/cairo-gl/5.frag
@@ -0,0 +1,16 @@
+uniform sampler2D source_sampler;
+varying vec2 source_texcoords;
+vec4 get_source()
+{
+ return texture2D(source_sampler, source_texcoords);
+}
+varying float mask_coverage;
+vec4 get_mask()
+{
+ return vec4(0, 0, 0, mask_coverage);
+}
+void main()
+{
+ gl_FragColor = get_source() * get_mask().a;
+}
+
diff --git a/shaders/cairo-gl/5.vert b/shaders/cairo-gl/5.vert
new file mode 100644
index 0000000..a1802af
--- /dev/null
+++ b/shaders/cairo-gl/5.vert
@@ -0,0 +1,12 @@
+varying vec2 source_texcoords;
+attribute vec4 Vertex;
+attribute vec4 Color;
+attribute vec4 MultiTexCoord0;
+attribute vec4 MultiTexCoord1;
+uniform mat4 ModelViewProjectionMatrix;
+void main()
+{
+ gl_Position = ModelViewProjectionMatrix * Vertex;
+ source_texcoords = MultiTexCoord0.xy;
+}
+
diff --git a/shaders/cairo-gl/6.frag b/shaders/cairo-gl/6.frag
new file mode 100644
index 0000000..1b53343
--- /dev/null
+++ b/shaders/cairo-gl/6.frag
@@ -0,0 +1,16 @@
+uniform vec4 source_constant;
+vec4 get_source()
+{
+ return source_constant;
+}
+uniform sampler2D mask_sampler;
+varying vec2 mask_texcoords;
+vec4 get_mask()
+{
+ return texture2D(mask_sampler, mask_texcoords);
+}
+void main()
+{
+ gl_FragColor = get_source().a * get_mask();
+}
+
diff --git a/shaders/cairo-gl/7.frag b/shaders/cairo-gl/7.frag
new file mode 100644
index 0000000..ef8d27b
--- /dev/null
+++ b/shaders/cairo-gl/7.frag
@@ -0,0 +1,16 @@
+uniform vec4 source_constant;
+vec4 get_source()
+{
+ return source_constant;
+}
+uniform sampler2D mask_sampler;
+varying vec2 mask_texcoords;
+vec4 get_mask()
+{
+ return texture2D(mask_sampler, mask_texcoords);
+}
+void main()
+{
+ gl_FragColor = get_source() * get_mask();
+}
+
diff --git a/shaders/cairo-gl/8.frag b/shaders/cairo-gl/8.frag
new file mode 100644
index 0000000..bb36d42
--- /dev/null
+++ b/shaders/cairo-gl/8.frag
@@ -0,0 +1,14 @@
+uniform vec4 source_constant;
+vec4 get_source()
+{
+ return source_constant;
+}
+vec4 get_mask()
+{
+ return vec4 (0, 0, 0, 1);
+}
+void main()
+{
+ gl_FragColor = get_source() * get_mask().a;
+}
+
diff --git a/shaders/cairo-gl/9.frag b/shaders/cairo-gl/9.frag
new file mode 100644
index 0000000..89bb34b
--- /dev/null
+++ b/shaders/cairo-gl/9.frag
@@ -0,0 +1,15 @@
+uniform sampler2D source_sampler;
+varying vec2 source_texcoords;
+vec4 get_source()
+{
+ return texture2D(source_sampler, source_texcoords);
+}
+vec4 get_mask()
+{
+ return vec4 (0, 0, 0, 1);
+}
+void main()
+{
+ gl_FragColor = get_source() * get_mask().a;
+}
+