<commit_before>[shaders]
vertex =
    uniform highp mat4 u_modelViewProjectionMatrix;
    uniform lowp float u_active_extruder;
    uniform lowp float u_shade_factor;
    uniform highp int u_layer_view_type;

    attribute highp float a_extruder;
    attribute highp float a_line_type;
    attribute highp vec4 a_vertex;
    attribute lowp vec4 a_color;
    attribute lowp vec4 a_material_color;

    varying lowp vec4 v_color;
    varying float v_line_type;

    void main()
    {
        gl_Position = u_modelViewProjectionMatrix * a_vertex;
        // shade the color depending on the extruder index
        v_color = a_color;
        // 8 and 9 are travel moves
        if ((a_line_type != 8.0) && (a_line_type != 9.0)) {
            v_color = (a_extruder == u_active_extruder) ? v_color : vec4(u_shade_factor * v_color.rgb, v_color.a);
        }

        v_line_type = a_line_type;
    }

fragment =
    varying lowp vec4 v_color;
    varying float v_line_type;

    uniform int u_show_travel_moves;
    uniform int u_show_support;
    uniform int u_show_adhesion;
    uniform int u_show_skin;
    uniform int u_show_infill;

    void main()
    {
        if ((u_show_travel_moves == 0) && (v_line_type >= 7.5) && (v_line_type <= 9.5)) {  // actually, 8 and 9
            // discard movements
            discard;
        }
        // support: 4, 7, 10
        if ((u_show_support == 0) && (
            ((v_line_type >= 3.5) && (v_line_type <= 4.5)) ||
            ((v_line_type >= 6.5) && (v_line_type <= 7.5)) ||
            ((v_line_type >= 9.5) && (v_line_type <= 10.5))
            )) {
            discard;
        }
        // skin: 1, 2, 3
        if ((u_show_skin == 0) && (
            (v_line_type >= 0.5) && (v_line_type <= 3.5)
            )) {
            discard;
        }
        // adhesion:
        if ((u_show_adhesion == 0) && (v_line_type >= 4.5) && (v_line_type <= 5.5)) {
            // discard movements
            discard;
        }
        // infill:
        if ((u_show_infill == 0) && (v_line_type >= 5.5) && (v_line_type <= 6.5)) {
            // discard movements
            discard;
        }

        gl_FragColor = v_color;
    }

vertex41core =
    #version 410
    uniform highp mat4 u_modelViewProjectionMatrix;
    uniform lowp float u_active_extruder;
    uniform lowp float u_shade_factor;
    uniform highp int u_layer_view_type;

    in highp int a_extruder;
    in highp int a_line_type;
    in highp vec4 a_vertex;<commit_msg>Fix 4.1 shader for line types. CURA-3273<commit_after>[shaders]
vertex =
    uniform highp mat4 u_modelViewProjectionMatrix;
    uniform lowp float u_active_extruder;
    uniform lowp float u_shade_factor;
    uniform highp int u_layer_view_type;

    attribute highp float a_extruder;
    attribute highp float a_line_type;
    attribute highp vec4 a_vertex;
    attribute lowp vec4 a_color;
    attribute lowp vec4 a_material_color;

    varying lowp vec4 v_color;
    varying float v_line_type;

    void main()
    {
        gl_Position = u_modelViewProjectionMatrix * a_vertex;
        // shade the color depending on the extruder index
        v_color = a_color;
        // 8 and 9 are travel moves
        if ((a_line_type != 8.0) && (a_line_type != 9.0)) {
            v_color = (a_extruder == u_active_extruder) ? v_color : vec4(u_shade_factor * v_color.rgb, v_color.a);
        }

        v_line_type = a_line_type;
    }

fragment =
    varying lowp vec4 v_color;
    varying float v_line_type;

    uniform int u_show_travel_moves;
    uniform int u_show_support;
    uniform int u_show_adhesion;
    uniform int u_show_skin;
    uniform int u_show_infill;

    void main()
    {
        if ((u_show_travel_moves == 0) && (v_line_type >= 7.5) && (v_line_type <= 9.5)) {  // actually, 8 and 9
            // discard movements
            discard;
        }
        // support: 4, 7, 10
        if ((u_show_support == 0) && (
            ((v_line_type >= 3.5) && (v_line_type <= 4.5)) ||
            ((v_line_type >= 6.5) && (v_line_type <= 7.5)) ||
            ((v_line_type >= 9.5) && (v_line_type <= 10.5))
            )) {
            discard;
        }
        // skin: 1, 2, 3
        if ((u_show_skin == 0) && (
            (v_line_type >= 0.5) && (v_line_type <= 3.5)
            )) {
            discard;
        }
        // adhesion:
        if ((u_show_adhesion == 0) && (v_line_type >= 4.5) && (v_line_type <= 5.5)) {
            // discard movements
            discard;
        }
        // infill:
        if ((u_show_infill == 0) && (v_line_type >= 5.5) && (v_line_type <= 6.5)) {
            // discard movements
            discard;
        }

        gl_FragColor = v_color;
    }

vertex41core =
    #version 410
    uniform highp mat4 u_modelViewProjectionMatrix;
    uniform lowp float u_active_extruder;
    uniform lowp float u_shade_factor;
    uniform highp int u_layer_view_type;

    in highp float a_extruder;
    in highp float a_line_type;
    in highp vec4 a_vertex;
{'fraction_non_alphanumeric': 0.1060757970723882, 'fraction_numerical': 0.026468818929215963, 'mean_word_length': 2.034063260340633, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '2246085', 'n_tokens_mistral': 1839, 'n_tokens_neox': 1732, 'n_words': 417}