Starting to support textures

This commit is contained in:
Thomas Forgione
2018-02-26 14:59:32 +01:00
parent 80b397d3ec
commit b25dddaa9c
7 changed files with 201 additions and 27 deletions
+4 -1
View File
@@ -1,8 +1,11 @@
#version 140
in vec2 v_tex_coords;
out vec4 color;
uniform sampler2D tex;
void main() {
color = vec4(1.0, 0.0, 0.0, 1.0);
color = texture(tex, v_tex_coords);
}
+8 -1
View File
@@ -1,7 +1,14 @@
#version 140
in vec3 vertex;
in vec2 tex_coords;
uniform mat4 perspective;
uniform mat4 view;
out vec2 v_tex_coords;
void main() {
gl_Position = vec4(vertex, 1.0);
v_tex_coords = tex_coords;
gl_Position = perspective * view * vec4(vertex, 1.0);
}