Starting to support textures
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user