#version 330 core

varying vec2 texCoord;
uniform sampler2D colorMap;
uniform sampler2D depthMap;
uniform sampler2D blurintensity;
/*
void main (void)
{
    float maxsize=20.0f; //20.0f
    float xpix=1.0f/1920.0f;
    float ypix=1.0f/1080.0f;
    float depth=(texture2D(depthMap, texCoord)).r;
    float blursize=(texture2D(blurintensity, vec2(depth,0.0f))).r*maxsize;
    //blursize=0; // for testing purposes when blur just gets in the way, to be commented out
    //float blursize=depth*maxsize;
    vec4 acccolor=vec4(vec3(0.0f),1.0f);
    int counter=0;
    if (blursize>3.0f){
        for (float y=-blursize;y<blursize;y+=3.0f)
            for (float x=-blursize;x<blursize;x+=3.0f)
            {
               acccolor+=texture2D(colorMap, vec2(clamp(texCoord.x+xpix*x,0.0f,0.99999f),clamp(texCoord.y+ypix*y,0.0f,0.99999f)));
               counter++;
            //gl_FragColor = texture2D(colorMap, texCoord);
            }
        gl_FragColor = acccolor/counter;
    }
    else
    {
        gl_FragColor = texture2D(colorMap, texCoord);
    }
}
*/
void main (void)
{
gl_FragColor = texture2D(colorMap, texCoord);
}
