UPDATE #1: showing below how I retrieve the uniform location:
void Program::AddUniformLocation(GLchar *name)
{
GLint location = glGetUniformLocation(program, name);
if (location != -1)
{
uniformList.insert(pair<GLchar*, GLint>(name, location));
}
else
{
printf("Error: the uniform \"%s\" doesn't exist, or isn't used, in program\n", name);
}
}
UPDATE #2: I'm writing some scenarios here, some works, some doesn't. I'm getting insane, I really hope it isn't something very silly that is wrong. :)
vec3 diffuse = uniDiffuse * max(dot(N, L), 0.0);
vec3 specular = uniSpecular * pow(max(dot(R, V), 0.0), uniShininess);
// This works, 1.0 instead of uniAlpha.
fragColor = vec4(uniEmissive + uniAmbient + diffuse + specular, 1.0);
// Doesn't work, added uniAlpha
fragColor = vec4(uniEmissive + uniAmbient + diffuse + specular, uniAlpha);
// These are working
fragColor = vec4(uniEmissive, uniAlpha);
fragColor = vec4(uniEmissive + uniAmbient, uniAlpha);
// Adding diffuse doesn't work.
fragColor = vec4(uniEmissive + uniAmbient + diffuse, uniAlpha);
// Just diffuse, works!
fragColor = vec4(diffuse, uniAlpha);