In first shader you have error in this line - texColor.rgb = 1.0 - texColor.rgb;
You need to write:
texColor.rgb = vec3(1.0) - texColor.rgb;
In second shader you have error in this line - vec4 color = dot(gray, texColor);
Gray is vec3, texcolor is vec4. What is dot product between vec3 and vec4? There is no such dot
function that does that. You can call either float dot(vec3, vec3)
or float dot(vec4, vec4)
. So change that line to:
vec4 color = vec4(dot(gray, texColor.rgb));
or
vec4 color = vec4(dot(vec4(gray, ???), texColor)); // put in ??? float number you want
(and next time please show us in which line exactly error occurs)