diff options
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; +} +)"; |