title: GLSL break command
body: <p>Currently I am learning how to create shaders in GLSL for a game engine I am working on, and I have a question regarding the language which puzzles me. I have learned that in shader versions lower than 3.0 you cannot use uniform variables in the condition of a loop. For example the following code would not work in shader versions older than 3.0.</p>
  
  <pre><code>for (int i = 0; i &lt; uNumLights; i++)
  {
     ...............
  }
  </code></pre>
  
  <p>But isn't it possible to replace this with a loop with a fixed amount of iterations, but containing a conditional statement which would break the loop if i, in this case, is greater than uNumLights?. Ex : </p>
  
  <pre><code>for (int i = 0; i &lt; MAX_LIGHTS; i++)
  {
      if(i &gt;= uNumLights)
          break;
      ..............
  }
  </code></pre>
  
  <p>Aren't these equivalent? Should the latter work in older versions GLSL? And if so, isn't this more efficient and easy to implement than other techniques that I have read about, like using a different version of the shader for different number of lights? <br>
  I know this might be a silly question, but I am a beginner and I cannot find a reason why this shouldn't work.</p>