##start
##vertex

#version 150
#extension GL_ARB_explicit_attrib_location : enable


layout(location=0) in vec3 in_Position;
layout(location=1) in vec2 in_Tc;

uniform mat4 projMatrix;
uniform mat4 modelMatrix;
uniform sampler2D diffuseTex;


out vec2 tc;

void main()
{

    gl_Position =  projMatrix  * modelMatrix*vec4(in_Position,1); ;
    tc = in_Tc;

}

##end

##start
##fragment

#version 150 core

in vec4 normal;
in vec2 tc;

uniform sampler2D diffuseTex;
uniform vec4 backgroundColor;

out vec4 out_color;

void main(void)
{
//    out_color = backgroundColor;
//    vec4 texColor = texture(diffuseTex,tc);
//    if (texColor.a != 0){
//        out_color = texColor;
//    }
    out_color = mix(texture(diffuseTex,tc ) +  backgroundColor, texture(diffuseTex,tc ), texture(diffuseTex,tc ).a);

    bool showBounds = false;
    if (showBounds)
        if (out_color.a == 0){
            out_color = vec4(1,0,0,0.5);

        }
}

##end
