 
   occlusion = 0;
 
-  for(int i = 0; i < sampleSize; i++)
+  for(int i = 0; i < nrOfSamples; i++)
   {
     vec3 samplePoint = TBN * samplePoints[i];
     samplePoint = viewPosition + samplePoint * sampleRadius;


uniform vec2 noiseScale;

uniform int sampleSize;
uniform float sampleRadius;
uniform float sampleBias;
uniform vec3 samplePoints[64];

    vec2 sampleUV = (sampleProjection.xy / sampleProjection.w) * 0.5 + 0.5;
    float sampleDepth = (viewMatrix * texture(positionMap, sampleUV)).z;

    occlusion += sampleDepth >= samplePoint.z + sampleBias ? 1.0 : 0.0;
  }
}
