<commit_before>precision mediump float;
uniform sampler2D uSampler;
varying vec2 vTexCoord;

uniform int uRadius;
uniform int uWidth;
uniform int uHeight;
uniform bool uHorizontal;

void main () {

    vec2 pixelSize = vec2(1.0, 1.0) / vec2(uWidth, uHeight);
    vec4 colorSum = vec4(0.0);


    if(uRadius == 0) {
        gl_FragColor = texture2D(uSampler, vTexCoord);
    } else {

        for(int i = 2048; i >= 0; i -= 1) {

            if(i < (2048 - (uRadius * 2))) {
                break;
            }

            int offset = uRadius - (2048 - i);
            int posOffset = int(abs(float(offset)));

            if(uHorizontal) {
                colorSum += texture2D(uSampler, vTexCoord + (pixelSize * vec2(offset, 0) ));
            } else {
                colorSum += texture2D(uSampler, vTexCoord + (pixelSize * vec2(0, offset) ));// * weight;
            }


        }

        float totes = ((float(uRadius) * 2.0) + 1.0) ;
        float divy = 1.0 / totes;

        gl_FragColor = vec4(colorSum.rgb * divy, 1.0);
    }

}<commit_msg>refactored fragment shader<commit_after>precision mediump float;
uniform sampler2D uSampler;
varying vec2 vTexCoord;

uniform int uRadius;
uniform int uWidth;
uniform int uHeight;
uniform bool uHorizontal;

vec4 addColors () {

  vec4 colorSum = vec4(0.0);
  vec2 pixelSize = vec2(1.0, 1.0) / vec2(uWidth, uHeight);

  for(int i = 2048; i >= 0; i -= 1) {

      if(i < (2048 - (uRadius * 2))) {
          break;
      }

      int offset = uRadius - (2048 - i);
      if(uHorizontal) {
          colorSum += texture2D(uSampler, vTexCoord + (pixelSize * vec2(offset, 0) ));
      } else {
          colorSum += texture2D(uSampler, vTexCoord + (pixelSize * vec2(0, offset) ));
      }
  }

  return colorSum;
}

void main () {

    if(uRadius == 0) {
        gl_FragColor = texture2D(uSampler, vTexCoord);
    } else {
      vec4 colorSum = addColors();
      float totes = ((float(uRadius) * 2.0) + 1.0) ;
      float divy = 1.0 / totes;
      gl_FragColor = vec4(colorSum.rgb * divy, 1.0);
    }

}
{'fraction_non_alphanumeric': 0.13499025341130605, 'fraction_numerical': 0.04483430799220273, 'mean_word_length': 2.178018575851393, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6857044', 'n_tokens_mistral': 790, 'n_tokens_neox': 731, 'n_words': 177}