From 7bfd449c60dcbd9a75073b8e024b11e7b63b01e8 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Wed, 14 Apr 2021 11:29:16 +0000 Subject: add main shaders --- main.frag | 12 ++++++++++++ main.vs | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 main.frag create mode 100644 main.vs diff --git a/main.frag b/main.frag new file mode 100644 index 0000000..afb9829 --- /dev/null +++ b/main.frag @@ -0,0 +1,12 @@ +#version 330 core + +in vec2 tex_coords; + +out vec4 color; + +uniform sampler2D ourTexture1; + +void main() +{ + color = texture(ourTexture1, tex_coords); +} diff --git a/main.vs b/main.vs new file mode 100644 index 0000000..066d6d8 --- /dev/null +++ b/main.vs @@ -0,0 +1,14 @@ +#version 330 core +layout (location = 0) in vec3 position; +layout (location = 2) in vec2 tex_pos; + +out vec2 tex_coords; + +uniform mat4 model; +uniform mat4 proj_view; + +void main() +{ + gl_Position = proj_view * model * vec4(position, 1.0f); + tex_coords = vec2(tex_pos.x, 1.0f - tex_pos.y); +} -- cgit v1.2.3-18-g5258