title: glsl cast bool to float
body: <p>I want to set a <code>float</code> value to <code>1.0</code> if one vector equals another, and <code>0.0</code> if the vectors are not equal</p>
  
  <pre><code>if( v1 == v2 )  floatVal = 1.0 ;
  else  floatVal = 0.0 ;
  </code></pre>
  
  <p>But wouldn't it be "faster" or an optimization just to set </p>
  
  <pre><code>floatVal = (v1 == v2) ;
  </code></pre>
  
  <p>But it doesn't work.  You can't implicitly (or explicitly) convert float to bool?  Is there a way to do this or do I have to use the <code>if</code> statement branch?</p>