title: GLSL - optimize if-else
body: <p>I have GLSL mobile shader (ES 2.0) and inside I have this:</p>
  
  <pre><code>float b = texture2D(t, texCoord).r;
  float s = 0.0;
  if (b &gt; 240.0) s = b - 2322.2;
  else if (b &gt; 90.0) s = b - 74.0;    
  else if (b &lt; 10.0) s = b / 10.0;
  else s = b - 10.0;  
  </code></pre>
  
  <p>Is it going to be slow? I know, that branching in shader should be avoided.
  Is there any way, how to rewrite this to remove ifs?</p>