I am trying to convert some opengl glsl to opengl es (2.0) glsl. I am passing a byte value into the fragment shader by casting it to a float in my code and then casting it back in the shader. I then need to split the result into two values between 0-15. For opengl glsl I am using
int x = int(a_otherdata);
int a = (x >> 4) & 0xF;
int b = x & 0xF;
However, I since opengl es does not support bitwise operations I tried doing the following, but it doesn't work.
int x = int(a_otherdata);
int a = x / 16;
int b = x - (a * 16);