aboutsummaryrefslogtreecommitdiff
path: root/src/shader
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-05-21 21:16:56 +0200
committerAdrian Kummerlaender2018-05-21 21:20:08 +0200
commit617fec827652d216e2d1e5015f816c4400655d73 (patch)
treec2bdce2d375bebc4b7c9907543d57aeb642f7f82 /src/shader
parenta8feed9d7951c9a947562ed687c704851a31ea9b (diff)
downloadcomputicle-617fec827652d216e2d1e5015f816c4400655d73.tar
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.gz
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.bz2
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.lz
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.xz
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.zst
computicle-617fec827652d216e2d1e5015f816c4400655d73.zip
Abstract texture display buffer, shader
Diffstat (limited to 'src/shader')
-rw-r--r--src/shader/display_fragment.glsl11
-rw-r--r--src/shader/display_vertex.glsl12
2 files changed, 23 insertions, 0 deletions
diff --git a/src/shader/display_fragment.glsl b/src/shader/display_fragment.glsl
new file mode 100644
index 0000000..8b98ce1
--- /dev/null
+++ b/src/shader/display_fragment.glsl
@@ -0,0 +1,11 @@
+static const std::string DISPLAY_FRAGMENT_SHADER_CODE = R"(
+#version 330 core
+
+out vec4 FragColor;
+in vec2 TexCoords;
+uniform sampler2D screen_texture;
+
+void main() {
+ FragColor = texture(screen_texture, TexCoords);
+}
+)";
diff --git a/src/shader/display_vertex.glsl b/src/shader/display_vertex.glsl
new file mode 100644
index 0000000..60bbfc7
--- /dev/null
+++ b/src/shader/display_vertex.glsl
@@ -0,0 +1,12 @@
+static const std::string DISPLAY_VERTEX_SHADER_CODE = R"(
+#version 330 core
+
+layout (location = 0) in vec2 screen_vertex;
+layout (location = 1) in vec2 texture_vertex;
+out vec2 TexCoords;
+
+void main() {
+ gl_Position = vec4(screen_vertex, 0.0, 1.0);
+ TexCoords = texture_vertex;
+}
+)";