summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-03-13 13:27:36 -0700
committerEric Anholt <eric@anholt.net>2012-03-13 13:29:23 -0700
commit718c9beef680a7fe549cda571363610712460533 (patch)
tree36b84256c3cacfc3abc12a8abef118d70e2f161c
parent7244cfb2fed9d066de4301e49643961dd885f7ff (diff)
weston: Import shaders from the Weston project.
-rw-r--r--COPYING25
-rw-r--r--shaders/weston/1.frag14
-rw-r--r--shaders/weston/1.vert10
-rw-r--r--shaders/weston/2.frag9
-rw-r--r--shaders/weston/2.vert10
-rw-r--r--shaders/weston/3.frag6
-rw-r--r--shaders/weston/3.vert10
-rw-r--r--shaders/weston/4.frag9
-rw-r--r--shaders/weston/4.vert6
-rw-r--r--shaders/weston/5.frag19
-rw-r--r--shaders/weston/5.vert7
-rw-r--r--shaders/weston/6.frag7
-rw-r--r--shaders/weston/6.vert12
13 files changed, 144 insertions, 0 deletions
diff --git a/COPYING b/COPYING
index 4b08a62..11c993f 100644
--- a/COPYING
+++ b/COPYING
@@ -98,6 +98,31 @@ Copyright (C) 2005 Stuart Dalton (badcdev@gmail.com)
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+shaders/weston:
+/*
+ * Copyright © 2010-2011 Intel Corporation
+ * Copyright © 2008-2011 Kristian Høgsberg
+ * Copyright © 2012 Collabora, Ltd.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The copyright holders make
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
shaders/yofrankie:
From the website:
"The Apricot open game project, the data we’ve published online
diff --git a/shaders/weston/1.frag b/shaders/weston/1.frag
new file mode 100644
index 0000000..987aa56
--- /dev/null
+++ b/shaders/weston/1.frag
@@ -0,0 +1,14 @@
+precision mediump float;
+varying vec2 v_texcoord;
+uniform sampler2D tex;
+uniform float alpha;
+uniform float texwidth;
+void main()
+{
+ if (v_texcoord.x < 0.0 || v_texcoord.x > texwidth ||
+ v_texcoord.y < 0.0 || v_texcoord.y > 1.0)
+ discard;
+ gl_FragColor = texture2D(tex, v_texcoord)
+; gl_FragColor = alpha * gl_FragColor;
+}
+
diff --git a/shaders/weston/1.vert b/shaders/weston/1.vert
new file mode 100644
index 0000000..7b4e1b7
--- /dev/null
+++ b/shaders/weston/1.vert
@@ -0,0 +1,10 @@
+uniform mat4 proj;
+attribute vec2 position;
+attribute vec2 texcoord;
+varying vec2 v_texcoord;
+void main()
+{
+ gl_Position = proj * vec4(position, 0.0, 1.0);
+ v_texcoord = texcoord;
+}
+
diff --git a/shaders/weston/2.frag b/shaders/weston/2.frag
new file mode 100644
index 0000000..e290824
--- /dev/null
+++ b/shaders/weston/2.frag
@@ -0,0 +1,9 @@
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+
diff --git a/shaders/weston/2.vert b/shaders/weston/2.vert
new file mode 100644
index 0000000..7b4e1b7
--- /dev/null
+++ b/shaders/weston/2.vert
@@ -0,0 +1,10 @@
+uniform mat4 proj;
+attribute vec2 position;
+attribute vec2 texcoord;
+varying vec2 v_texcoord;
+void main()
+{
+ gl_Position = proj * vec4(position, 0.0, 1.0);
+ v_texcoord = texcoord;
+}
+
diff --git a/shaders/weston/3.frag b/shaders/weston/3.frag
new file mode 100644
index 0000000..4c72c26
--- /dev/null
+++ b/shaders/weston/3.frag
@@ -0,0 +1,6 @@
+uniform vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+
diff --git a/shaders/weston/3.vert b/shaders/weston/3.vert
new file mode 100644
index 0000000..03b57f1
--- /dev/null
+++ b/shaders/weston/3.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/weston/4.frag b/shaders/weston/4.frag
new file mode 100644
index 0000000..544ecfa
--- /dev/null
+++ b/shaders/weston/4.frag
@@ -0,0 +1,9 @@
+#version 130
+uniform ivec4 color;
+out ivec4 out_color;
+
+void main()
+{
+ out_color = color;
+}
+
diff --git a/shaders/weston/4.vert b/shaders/weston/4.vert
new file mode 100644
index 0000000..b081d0f
--- /dev/null
+++ b/shaders/weston/4.vert
@@ -0,0 +1,6 @@
+attribute vec4 position;
+void main()
+{
+ gl_Position = position;
+}
+
diff --git a/shaders/weston/5.frag b/shaders/weston/5.frag
new file mode 100644
index 0000000..1d1b4ff
--- /dev/null
+++ b/shaders/weston/5.frag
@@ -0,0 +1,19 @@
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D source_sampler;
+uniform vec2 source_texdims;
+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;
+}
+
diff --git a/shaders/weston/5.vert b/shaders/weston/5.vert
new file mode 100644
index 0000000..0fbd261
--- /dev/null
+++ b/shaders/weston/5.vert
@@ -0,0 +1,7 @@
+#version 130
+attribute vec4 position;
+void main()
+{
+ gl_Position = position;
+}
+
diff --git a/shaders/weston/6.frag b/shaders/weston/6.frag
new file mode 100644
index 0000000..8857b30
--- /dev/null
+++ b/shaders/weston/6.frag
@@ -0,0 +1,7 @@
+precision mediump float;
+uniform vec4 color;
+void main()
+{
+ gl_FragColor = color
+;}
+
diff --git a/shaders/weston/6.vert b/shaders/weston/6.vert
new file mode 100644
index 0000000..a1802af
--- /dev/null
+++ b/shaders/weston/6.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;
+}
+