Fixed color renderer
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user