OpenGL shader error C1068:Too much data in type constructor
c++, opengl, shader
Solution
The error message is rather clear: You pass arguments to a constructor that are not valid. In this specific case, you try to pass a `vec4 changeColor` and an additional `float` to a `vec4` constructor (which means you pass 5 floats):
vec4(changeColor, 1.0f);
Since it is rather unclear what you want to do (or why you want to add 1.0f to a vec4), but you either have to change `changeColor` to a `vec3` or remove the `1.0f`.
Problem
I am following the tutorials on this site www.learnopengl.com,and at the end of shaders tutorial,I try to add my own uniform variable to fragment shader,which looks like this: ``` #version 330 core in vec3 ourColor; out vec4 color; uniform vec4 changeColor; void main() { color = vec4(changeColor, 1.0f); } ``` and I compile and change the uniform variable like this: ``` ourShader.Use(); GLint fragColorUniformLocation = glGetUniformLocation(ourShader.Program, "changeColor"); glUniform4f(fragColorUniformLocation, 0.0f, 1.0f, 0.0f, 1.0f); ``` ourShader.use() is just a method of class Shader which we wrote for Shader operations in tutorial,it simply just uses the said shader program. OpenGL renders everything just fine when I comment out my uniform variable and the two lines after ourShader.use().But when I try to add a uniform variable,shader compiler complains that there is too much data in type constructor.I searched the web and couldnt find anything useful,if this is a duplicate,just tell me and i will delete the post.