Try to complete a regular task. Like this:
void main()
{
vec4 myOutputColor = gl_Color;
gl_FragColor = myOutputColor;
}
Edit:
The second answer is also right, but there is no need to use the vec4 () constructor, since both are of the same type. If you let the (r, g, b, w) tuple say, you can write:
vec4 myOutputColor = vec4(r, g, b, w);
or
vec4 myOutputColor = vec4(myRgbColor, w);
etc.
source
share