I want to load a default colour vertColor if the sampler2D wasn't loaded with an image, to achieve that I have tried the following:
Fragment Shader:
#version 410
uniform sampler2D tex0;
in vec4 vertColor;
in vec2 TexCoords;
out vec4 fragColor;
void main( void )
{
vec4 texColor = texture(tex0, TexCoords);
if(tex0 == -1) fragColor = blinnPhongModel(vertColor);
else{
texColor.a = 1.0;
fragColor = texColor;
}//end of else
} // End of main
but it didn't work, how can I do that?