#version 130 in vec4 _color; in vec2 _tex_coord; out vec4 frag_color; uniform sampler2D sampler; uniform int has_texture; void main() { if (has_texture == 1) { frag_color = _color * texture(sampler, _tex_coord); } else { frag_color = _color; } }