in vec2 texCoord;
out vec4 fragColor;
uniform sampler2D texture0;
uniform vec4 color;// = vec4(1.0, 1.0, 1.0, 1.0);
uniform float enabled;

void main()
{

        float zNear = 0.05;
        float zFar  = 1000.0;
        float rawDepth = texture2D(texture0, texCoord).x;
        float worldZ = zNear * zFar / (zFar - rawDepth * (zFar - zNear));
        float c = clamp(1.0 - worldZ / 50.0, 0.0, 1.0);
        fragColor = vec4(c, c, c, 1.0);

}