/**
 * EDimensional disactivation fragment shader.
 * Copyright © 2009 Kirill Gavrilov <kirill@sview.ru>
 *
 * This code is licensed under MIT license (see docs/license-mit.txt for details).
 */

uniform int vpSizeY;
void main(void) {
    // compute current computing pixel Y coordinate from top
    int yFromTop = vpSizeY - int(floor(gl_FragCoord.y - 0.5)) - 1;

    // just simple color codes for ED on top
    if(yFromTop == 0 || yFromTop == 1) {
        gl_FragColor = vec4(1, 0, 0, 1);
    } else if(yFromTop == 2 || yFromTop == 3) {
        gl_FragColor = vec4(0, 1, 0, 1);
    } else if(yFromTop >= 4 && yFromTop <= 7) {
        gl_FragColor = vec4(1, 1, 0, 1);
    } else if(yFromTop == 8 || yFromTop == 9) {
        gl_FragColor = vec4(0, 0, 0, 1);
    } else {
        // set aplha channel to zero to draw unchanged pixels via Blending
        gl_FragColor = vec4(0, 1, 0, 0);
    }
}
