<commit_before>uniform float opacity;
uniform vec4 color;
uniform float ticks;

uniform sampler2D texture; // outfit texture
varying vec2 textureCoords; // outfit texture coords
uniform sampler2D maskTexture; // outfit color mask

uniform vec4 headColor;
uniform vec4 bodyColor;
uniform vec4 legsColor;
uniform vec4 feetColor;

vec4 calcPixel(vec2 texCoord)
{
    vec4 pixel = texture2D(texture, texCoord);
    vec4 maskColor = texture2D(maskTexture, texCoord);

    vec4 outColor = vec4(0);
    if(maskColor.r == 1.0 && maskColor.g == 1.0) {
        outColor = headColor;
    } else if(maskColor.r == 1.0) {
        outColor = bodyColor;
    } else if(maskColor.g == 1.0) {
        outColor = legsColor;
    } else if(maskColor.b == 1.0) {
        outColor = feetColor;
    }

    if(outColor.a != 0.0)
        pixel = pixel * outColor;
    return pixel;
}
void main()
{
    vec4 pixel = calcPixel(textureCoords);
    int num = 16;

    vec4 sum = vec4(0);
    int i, j;
    for(i=-num/2;i<num/2;++i) {
        for(j=-num/2;j<num/2;++j) {
            sum += calcPixel(textureCoords + vec2(i+1, j+1)*0.005) * 1.0/(num*num);
        }
    }
    sum = sin(ticks/500.0)*sum;

    gl_FragColor = pixel * color * opacity;
}<commit_msg>fix outfit shader<commit_after>uniform float opacity;
uniform vec4 color;
uniform float ticks;

uniform sampler2D texture; // outfit texture
varying vec2 textureCoords; // outfit texture coords
uniform sampler2D maskTexture; // outfit color mask

uniform vec4 headColor;
uniform vec4 bodyColor;
uniform vec4 legsColor;
uniform vec4 feetColor;

const vec4 yellow = vec4(1.0, 1.0, 0.0, 1.0);
const vec4 red = vec4(1.0, 0.0, 0.0, 1.0);
const vec4 green = vec4(0.0, 1.0, 0.0, 1.0);
const vec4 blue = vec4(0.0, 0.0, 1.0, 1.0);

vec4 calcOutfitPixel()
{
    vec4 pixel = texture2D(texture, textureCoords);
    vec4 maskColor = texture2D(maskTexture, textureCoords);

    vec4 outColor = vec4(1.0, 1.0, 1.0, 1.0);
    if(maskColor == yellow)
        outColor = headColor;
    else if(maskColor == red)
        outColor = bodyColor;
    else if(maskColor == green)
        outColor = legsColor;
    else if(maskColor == blue)
        outColor = feetColor;

    return pixel * outColor;
}

void main()
{
    gl_FragColor = calcOutfitPixel() * color * opacity;
}
{'fraction_non_alphanumeric': 0.1266432953549518, 'fraction_numerical': 0.050394390885188434, 'mean_word_length': 3.0335689045936394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '70241', 'n_tokens_mistral': 853, 'n_tokens_neox': 812, 'n_words': 219}