diff options
Diffstat (limited to 'source/shaders')
-rw-r--r-- | source/shaders/textured_quad.fs.glsl | 9 | ||||
-rw-r--r-- | source/shaders/textured_quad.vs.glsl | 14 |
2 files changed, 23 insertions, 0 deletions
diff --git a/source/shaders/textured_quad.fs.glsl b/source/shaders/textured_quad.fs.glsl new file mode 100644 index 0000000..e1a6100 --- /dev/null +++ b/source/shaders/textured_quad.fs.glsl @@ -0,0 +1,9 @@ +#version 330 core + +in vec2 TexCoords; +uniform sampler2D Texture; +out vec4 FragColor; + +void main() { + FragColor = texture(Texture, TexCoords); +}; diff --git a/source/shaders/textured_quad.vs.glsl b/source/shaders/textured_quad.vs.glsl new file mode 100644 index 0000000..7696b65 --- /dev/null +++ b/source/shaders/textured_quad.vs.glsl @@ -0,0 +1,14 @@ +#version 330 core +layout(location=0) in vec3 aPos; +layout(location=1) in vec2 aTex; + +uniform mat4 Model; +uniform mat4 View; +uniform mat4 Projection; + +out vec2 TexCoords; + +void main() { + gl_Position = Projection * View * Model * vec4(aPos, 1.0); + TexCoords = aTex; +} |