From 47d17c6674a16ad96a755967af06a8b7c979514e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 17 May 2011 20:37:43 -0700 Subject: shaders/cairo-gl: Initial import. --- shaders/cairo-gl/1.frag | 6 ++++++ shaders/cairo-gl/1.vert | 10 ++++++++++ shaders/cairo-gl/10.frag | 16 ++++++++++++++++ shaders/cairo-gl/2.frag | 17 +++++++++++++++++ shaders/cairo-gl/2.vert | 14 ++++++++++++++ shaders/cairo-gl/3.frag | 15 +++++++++++++++ shaders/cairo-gl/3.vert | 12 ++++++++++++ shaders/cairo-gl/4.frag | 16 ++++++++++++++++ shaders/cairo-gl/4.vert | 12 ++++++++++++ shaders/cairo-gl/5.frag | 16 ++++++++++++++++ shaders/cairo-gl/5.vert | 12 ++++++++++++ shaders/cairo-gl/6.frag | 16 ++++++++++++++++ shaders/cairo-gl/7.frag | 16 ++++++++++++++++ shaders/cairo-gl/8.frag | 14 ++++++++++++++ shaders/cairo-gl/9.frag | 15 +++++++++++++++ 15 files changed, 207 insertions(+) create mode 100644 shaders/cairo-gl/1.frag create mode 100644 shaders/cairo-gl/1.vert create mode 100644 shaders/cairo-gl/10.frag create mode 100644 shaders/cairo-gl/2.frag create mode 100644 shaders/cairo-gl/2.vert create mode 100644 shaders/cairo-gl/3.frag create mode 100644 shaders/cairo-gl/3.vert create mode 100644 shaders/cairo-gl/4.frag create mode 100644 shaders/cairo-gl/4.vert create mode 100644 shaders/cairo-gl/5.frag create mode 100644 shaders/cairo-gl/5.vert create mode 100644 shaders/cairo-gl/6.frag create mode 100644 shaders/cairo-gl/7.frag create mode 100644 shaders/cairo-gl/8.frag create mode 100644 shaders/cairo-gl/9.frag (limited to 'shaders') 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; +} + -- cgit v1.2.3