title: GLSL shaders and WebGL  problem
body: <p>I have created a shader that works perfectly in Firefox, but in Chrome the fragment and vertex shader cannot be linked. They compile just fine, but at the linking part something goes wrong. I have localized the problem at the fallowing bit of code : </p>
  
  <pre><code>        else if (uLightType[i] == 1) { //point light
  
          NdotL = dot(n, normalize(lightDir[i])); 
  
          if (NdotL &gt; 0.0) {
              distance = length(lightDir[i]);
              att = (1.0 / (uLightAttenuation[i] * distance * distance));
              color += vec3(uLightColor[i]  * NdotL * uLightIntensity[i] * att);                  
          }
  }
  </code></pre>
  
  <p>This small piece of code calculates the diffuse color reflected from a point light. It's part of a larger for loop. As it is shown here it won't link at all, but if I remove uLightAttenuation from calculating att, like so : </p>
  
  <pre><code>att = (1.0 / (distance * distance));    
  </code></pre>
  
  <p>it works just fine. If I replace it with any other uniform, say uLightIntensity, </p>
  
  <pre><code>att = (1.0 / (uLightIntensity[i] * distance * distance));
  </code></pre>
  
  <p>again it won't work. If I replace it with a simple constant value / float variabile, strangely enough it compiles. And what is even more strange is, if I remove att from calculating color, but keep the uniform at it's current position, it runs just fine:</p>
  
  <pre><code>att = (1.0 / (uLightAttenuation[i] * distance * distance));
  color += vec3(uLightColor[i]  * NdotL * uLightIntensity[i]);
  </code></pre>
  
  <p>The uniform is a float value, and even if it were a problem with type casting it should fail at compilation, not linking.<br>
  Here are the complete shaders, maybe I missed something elsewhere in the code.</p>
  
  <p><a href="http://students.info.uaic.ro/~catalin.dumitru/game/shaders/phong.vshader" rel="nofollow">Fragment Shader</a> <br>
  <a href="http://students.info.uaic.ro/~catalin.dumitru/game/shaders/phong.fshader" rel="nofollow">Vertex Shader</a></p>