I get this error while trying to add lighting
Message: Error has been generated. GL error GL_INVALID_OPERATION in Uniform1i: (ID: 2882512024) GL error GL_INVALID_OPERATION: mismatched type setting uniform of location "4" in program 1, "" using shaders, 2, "", 3, ""
type: ERROR --- id: 1282 --- severity: HIGH
this is my fragmentshader
out vec4 color;
in VS_OUT
{
vec2 tc;
vec3 normals;
}
fs_in;
layout(binding=0)uniform sampler2D tex;
uniform vec3 lightColor;
void main(void)
{
color= texture(tex, fs_in.tc)* vec4(lightColor, 1.0);
}
I have this in my render
GLint lightColor_location = glGetUniformLocation(program, "lightColor");
glUniform1i(lightColor_location, 0);
glUniform3f(lightColor_location, lightColor.r, lightColor.g, lightColor.b);
and this declared
glm::vec3 lightColor = glm::vec3(1.0f, 1.0f, 1.0f);
```