can GL_COMBINE implement a expression with if else

hi, everyone!

i try to implement a algorithm about overlay (like photoshop feature.)
and the expression is {v2 < 128 ? (2 * v1 * v2 / 255) : (255 - 2 * (255-v1) * (255-v2) / 255)}.
and i failed to merge the two expressions.
btw. I can’t implement it with shader because i’'m using opengles 1.1.

thx for any reply

Hi !

You can try this:
float f_test = v2 < 128;
float f_result = f_test * (2 * v1 * v2 / 255) + (1-f_test) * (255 - 2 * (255-v1) * (255-v2) / 255);

Good Luck !

YoYOOOoOO

thx for your reply, but i don’t think GL_COMBINE can implement the complicated expression.