I don't know much about shaders but if branching is a problem you may consider something like this:
vec4 tmp1 = p.x < 0.5 ? D : F;
vec4 tmp2 = p.y < 0.5 ? H : B;
vec4 tmp3 = D == F || H == B ? E : tmp1;
gl_FragColor = tmp1 == tmp2 ? tmp3 : E;
It should be equivalent. Any compiler...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.