'<' : Wrong operand types. No operation '<' exists that takes a left-hand operand of type '4-component vector of float' and a right operand of type '4-component vector of float' (and there is no acceptable conversion)
1 compilation errors. No code generated.
But when I compare with vec4(0.0) or vec4(1.0) no error is shown.
You can perform element-wise comparisons with the functions lessThan, lessThanEqual, greaterThan, and greaterThanEqual. These return boolean vectors (bvec4 etc), which can’t be used as the condition of an if statement.
Depending on what logic you’d like to apply here, consider wrapping that condition with the any() or all() functions, which map a bool vector to a bool scalar result. For instance: