diff options
author | Adrian Kummerlaender | 2018-05-21 21:16:56 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2018-05-21 21:20:08 +0200 |
commit | 617fec827652d216e2d1e5015f816c4400655d73 (patch) | |
tree | c2bdce2d375bebc4b7c9907543d57aeb642f7f82 /src/shader | |
parent | a8feed9d7951c9a947562ed687c704851a31ea9b (diff) | |
download | computicle-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.glsl | 11 | ||||
-rw-r--r-- | src/shader/display_vertex.glsl | 12 |
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; +} +)"; |