Fixed color renderer

This commit is contained in:
2018-10-31 11:55:17 +01:00
parent 8bea93e865
commit 28189bbd33
4 changed files with 33 additions and 14 deletions
+5 -1
View File
@@ -4,12 +4,16 @@ uniform sampler2D tex;
uniform vec3 diffuse;
in vec3 v_color;
in vec2 v_tex_coords;
out vec4 color;
void main() {
color = vec4(v_color, 1.0);
color = vec4(v_color.x, v_color.y, v_color.z, 1.0);
if (texture(tex, v_tex_coords).a < 0.05) {
discard;
}
}
+2
View File
@@ -10,8 +10,10 @@ in vec3 normal;
in vec3 face_color;
out vec3 v_color;
out vec2 v_tex_coords;
void main() {
v_color = face_color;
v_tex_coords = vec2(tex_coords.x * texture_size.x, tex_coords.y * texture_size.y);
gl_Position = perspective * view * vec4(vertex, 1.0);
}