title: Giving green a value somehow clears red
body: <p>I have a pixel shader in which I have the following part</p>
  
  <pre><code>imgcolor.b = 0;
  imgcolor.r = 1 - dist1 / 5;
  imgcolor.g = 0;
  </code></pre>
  
  <p>if I make the following change</p>
  
  <pre><code>imgcolor.b = 0;
  imgcolor.r = 1 - dist1 / 5;
  imgcolor.g = 1 - min(1,max(0,dist2));
  </code></pre>
  
  <p>where both dist1 and dist2 are float the red value becomes 0 in parts where it shouldn't be.
  Why does this happen? How do I prevent it?</p>
  
  <p>First case: <a href="https://www.dropbox.com/s/bq2irg4nsjarne2/good.jpg?dl=0" rel="nofollow">https://www.dropbox.com/s/bq2irg4nsjarne2/good.jpg?dl=0</a></p>
  
  <p>Second case: <a href="https://www.dropbox.com/s/jy0z2zk56h9jl96/wrong.jpg?dl=0" rel="nofollow">https://www.dropbox.com/s/jy0z2zk56h9jl96/wrong.jpg?dl=0</a></p>