



#ifndef BYPASS_PIXEL_SHADER
    vec2 tex_size_ali = vec2(textureSize(TEXTURE_0,0));
    vec2 uv_ali = mix(uv0 * tex_size_ali, uv0, step(1.0, max(uv0.x, uv0.y)));
    vec4 tex_ali = texelFetch(TEXTURE_0, ivec2(uv_ali), 0);
    float testalpha_ali = tex_ali.a;
    bvec4 xray_alpha_control = ali_xray_alpha_control(testalpha_ali);
    float testlight_ali = texelFetch(TEXTURE_1, ivec2(0), 0).r;
    bvec2 xray_light_control = ali_xray_light_control(testlight_ali);
    
    //后边动了gl_FragDepth，必须预设。
    gl_FragDepth = gl_FragCoord.z;
    //石头边框矿透——Light：X丨Alpha：X
    if(xray_light_control.x && xray_alpha_control.x) {
        discard;
    }
    
    #ifdef FANCY
        //类实体透视——Light：None丨Alpha：Y丨跟随精美图像开关
        if(xray_alpha_control.y) {
            gl_FragDepth = gl_FragCoord.z / (1.980-(gl_FragCoord.w)*Reciprocal_980);
            replace_fragcolor_ali = tex_ali;
            return;
        }
    #endif
    
    //矿物高亮描边——Light：Y丨Alpha：Z
    if(xray_light_control.y && xray_alpha_control.z) {
        gl_FragDepth = gl_FragCoord.z / (1.980-(gl_FragCoord.w)*Reciprocal_980);
        replace_fragcolor_ali = tex_ali;
        return;
    }
    
    #ifndef ALWAYS_LIT
        //变黑修复——Light：None丨Alpha：W（若启用了夜视则无需开启）
        if(xray_alpha_control.y || xray_alpha_control.z || xray_alpha_control.w) {
            replace_fragcolor_ali = tex_ali;
            return;
        }
    #endif
    
    //除雾：常驻
    vec4 fogColor = vec4(0.0);
#endif



