 
       light = lights[packedLightIndices >> 16];
       light.colorAndIntensity.w *= float(li + 1 < lightCount);
-        calcPointLightLighting(light, 
+        calcPointLightLighting(light,
           d, matParams, outColor);
     }
   }


  // Cloud shadows
  const vec4 posWS = uboPerFrame.invViewMatrix * vec4(d.posVS, 1.0);
  const float cloudShadows = mix(1.0, clamp(texture(noiseTex, 
    clamp(posWS.xz / 5000.0 * 0.5 + 0.5, 0.0, 1.0) * 5.0 
    + uboPerInstance.data0.x * 0.025).r * 3.0 - 0.5, 0.1, 1.0), uboPerFrame.postParams0.w);

  // Sunlight
  {
   const vec4 sunLightColorAndIntensity = uboPerFrame.sunLightColorAndIntensity;
    float shadowAttenuation = cloudShadows 
      * calcShadowAttenuation(d.posVS, uboPerInstance.shadowViewProjMatrix, shadowBufferTex);
    outColor.rgb += shadowAttenuation * sunLightColorAndIntensity.rgb * calcLighting(d);
    
    calcTransl(d, matParams, 
      clamp(uboPerFrame.sunLightDirWS.y - 0.3, 0.0, 1.0), // Dim for low sun
      sunLightColorAndIntensity, outColor);
  }


  // Pass through sky
  if (depth >= 1.0)
  {
    outColor.rgba = albedoSample;
    return;
  }
