diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2016-04-22 12:34:33 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2016-04-25 12:29:36 +0100 |
commit | 55537cccbd8129ed9fd3d00e8af07c05719516ac (patch) | |
tree | 73a1b55ca0e7931446c753347ce61668048b5162 /gdk/resources | |
parent | d7b5ea89eb7c103c67806b7d78a841a6c7048e90 (diff) | |
download | gtk+-55537cccbd8129ed9fd3d00e8af07c05719516ac.tar.gz |
gdk: Move GLSL shaders into GResource
Having the shaders inlined as C strings makes them harder to edit and
maintain.
Diffstat (limited to 'gdk/resources')
-rw-r--r-- | gdk/resources/glsl/gl2-texture-2d.fs.glsl | 9 | ||||
-rw-r--r-- | gdk/resources/glsl/gl2-texture-2d.vs.glsl | 13 | ||||
-rw-r--r-- | gdk/resources/glsl/gl2-texture-rect.fs.glsl | 9 | ||||
-rw-r--r-- | gdk/resources/glsl/gl2-texture-rect.vs.glsl | 13 | ||||
-rw-r--r-- | gdk/resources/glsl/gl3-texture-2d.fs.glsl | 11 | ||||
-rw-r--r-- | gdk/resources/glsl/gl3-texture-2d.vs.glsl | 13 | ||||
-rw-r--r-- | gdk/resources/glsl/gl3-texture-rect.fs.glsl | 9 | ||||
-rw-r--r-- | gdk/resources/glsl/gl3-texture-rect.vs.glsl | 13 |
8 files changed, 90 insertions, 0 deletions
diff --git a/gdk/resources/glsl/gl2-texture-2d.fs.glsl b/gdk/resources/glsl/gl2-texture-2d.fs.glsl new file mode 100644 index 0000000000..d0bacfbdeb --- /dev/null +++ b/gdk/resources/glsl/gl2-texture-2d.fs.glsl @@ -0,0 +1,9 @@ +#version 130 + +varying vec2 vUv; + +uniform sampler2D map; + +void main() { + gl_FragColor = texture2D (map, vUv); +} diff --git a/gdk/resources/glsl/gl2-texture-2d.vs.glsl b/gdk/resources/glsl/gl2-texture-2d.vs.glsl new file mode 100644 index 0000000000..bf9fdbb108 --- /dev/null +++ b/gdk/resources/glsl/gl2-texture-2d.vs.glsl @@ -0,0 +1,13 @@ +#version 130 + +uniform sampler2D map; + +attribute vec2 position; +attribute vec2 uv; + +varying vec2 vUv; + +void main() { + gl_Position = vec4(position, 0, 1); + vUv = uv; +} diff --git a/gdk/resources/glsl/gl2-texture-rect.fs.glsl b/gdk/resources/glsl/gl2-texture-rect.fs.glsl new file mode 100644 index 0000000000..fe0b870599 --- /dev/null +++ b/gdk/resources/glsl/gl2-texture-rect.fs.glsl @@ -0,0 +1,9 @@ +#version 130 + +varying vec2 vUv; + +uniform sampler2DRect map; + +void main() { + gl_FragColor = texture2DRect (map, vUv); +} diff --git a/gdk/resources/glsl/gl2-texture-rect.vs.glsl b/gdk/resources/glsl/gl2-texture-rect.vs.glsl new file mode 100644 index 0000000000..834d31d973 --- /dev/null +++ b/gdk/resources/glsl/gl2-texture-rect.vs.glsl @@ -0,0 +1,13 @@ +#version 130 + +uniform sampler2DRect map; + +attribute vec2 position; +attribute vec2 uv; + +varying vec2 vUv; + +void main() { + gl_Position = vec4(position, 0, 1); + vUv = uv; +} diff --git a/gdk/resources/glsl/gl3-texture-2d.fs.glsl b/gdk/resources/glsl/gl3-texture-2d.fs.glsl new file mode 100644 index 0000000000..fe353a6bad --- /dev/null +++ b/gdk/resources/glsl/gl3-texture-2d.fs.glsl @@ -0,0 +1,11 @@ +#version 150 + +in vec2 vUv; + +out vec4 vertexColor; + +uniform sampler2D map; + +void main() { + vertexColor = texture2D (map, vUv); +} diff --git a/gdk/resources/glsl/gl3-texture-2d.vs.glsl b/gdk/resources/glsl/gl3-texture-2d.vs.glsl new file mode 100644 index 0000000000..2c61f05d87 --- /dev/null +++ b/gdk/resources/glsl/gl3-texture-2d.vs.glsl @@ -0,0 +1,13 @@ +#version 150 + +uniform sampler2D map; + +in vec2 position; +in vec2 uv; + +out vec2 vUv; + +void main() { + gl_Position = vec4(position, 0, 1); + vUv = uv; +} diff --git a/gdk/resources/glsl/gl3-texture-rect.fs.glsl b/gdk/resources/glsl/gl3-texture-rect.fs.glsl new file mode 100644 index 0000000000..bf6884e6c0 --- /dev/null +++ b/gdk/resources/glsl/gl3-texture-rect.fs.glsl @@ -0,0 +1,9 @@ +#version 150 + +varying vec2 vUv; + +uniform sampler2DRect map; + +void main() { + gl_FragColor = texture2DRect (map, vUv); +} diff --git a/gdk/resources/glsl/gl3-texture-rect.vs.glsl b/gdk/resources/glsl/gl3-texture-rect.vs.glsl new file mode 100644 index 0000000000..874ef6c214 --- /dev/null +++ b/gdk/resources/glsl/gl3-texture-rect.vs.glsl @@ -0,0 +1,13 @@ +#version 150 + +uniform sampler2DRect map; + +attribute vec2 position; +attribute vec2 uv; + +varying vec2 vUv; + +void main() { + gl_Position = vec4(position, 0, 1); + vUv = uv; +} |