GLSL <> operadores em um vec4
Estou procurando um código GLSL mais recente que não seja compilado na minha versão atual do OpenGL e estou imaginando o que significa a forma abreviada do seguinte:
vec4 base;
if (base < 0.5) {
result = (2.0 * base * blend);
}
Isso equivale a:
if (base.r < 0.5 && base.g < 0.5 && base.b < 0.5 && base.a < 0.5) {
result.r = 2.0 * base.r * blend.r;
result.g = 2.0 * base.g * blend.g;
result.b = 2.0 * base.b * blend.b;
result.a = 2.0 * base.a * blend.a;
}
Editar
Error:
Fragment shader failed to compile with the following errors:
Wrong operand types no operation '<' exists that takes a left-hand operand of type 'highp 3-component vector of float' and a right operand of type 'const float' (or there is no acceptable conversion)
Eu também tentei:
(base.rgb < vec3(0.5))
... Wrong operand types no operation '<' exists that takes a left-hand operand of type 'highp 3-component vector of float' and a right operand of type 'const highp 3-component vector of float'
Estou assumindo que é porque estou usando o GLSL 1.2. ATI Radeon 3450