title: GLSL behavior when dealing with non-initialized uniforms
body: <p>I am creating a shader that would deal with up to, say, 10 point lights for a scene ; but I have trouble with the "up to". Here is what I want to do :</p>
  
  <pre><code>vec3 temp = CalcPointLight(pointLights[1], norm, FragPos, viewDir, fragDiffuse, fragSpecular);
  temp *= (1.0 - ShadowCalculationPointLight(FragPos, pointLights[1].position, pointLights[1].shadowCubeMap));
  temp *= pointLights[1].use;
  result += temp
  </code></pre>
  
  <p>So I have an array of structures <code>pointLights</code> and I'll just do the same thing for all 10 of them, and in order to avoid branching by adding <code>if</code>statements to check if the attribute <code>use</code>is equal to 1 I multiply the result of the light / shadow calculation by the <code>pointLights[1].value</code>.</p>
  
  <p>But for some reasons it seems that if the different attributes of <code>pointLights[1]</code>are not initialized, then the <code>result</code>variable (which is later sent as the fragment color) is not drawn anymore, even when the <code>temp</code> vector is supposed to be multiplied by 0.</p>
  
  <p>To me there are two solutions to that problem : either I have to generate / write a shader for each number of point lights I have to deal with (so if I want to use up to 10 lights I'll have to write 11 different shaders) ; or I always initialize all of my 10 lights with values that will make my functions always return <code>(0,0,0)</code>. For the latter solution I am not sure about how to initialize a <code>samplerCube</code> such that it will contain exclusively 0s... Or is there another solution ?</p>
  
  <p>EDIT : I am trying to implement the second solution but as I mentioned earlier but again, how should I initialize the samplerCube ? Should I have 6 textures of 1x1px loaded as a cubemap in the GPU memory and when I want to initialize the uniforms in my shaders, then send that "empty" cubemap sent, or is there a more fancy way of doing so (having a sampler giving only (0,0,0,1) ) ?</p>