/*
 * This software is governed by the CeCILL-B license under French law and
 * abiding by the rules of distribution of free software.  You can  use, 
 * modify and/ or redistribute the software under the terms of the CeCILL-B
 * license as circulated by CEA, CNRS and INRIA at the following URL
 * "http://www.cecill.info" or the LICENCE.txt file present in this project.
*/

const float far  = 100.;
const float near = 1.;

#if 0
varying in vec3 normal;



void main(void)
{
    vec3 normal_n = normalize(normal);
    float depth   = gl_FragCoord.z;//(2.0 * near) / (far + near - gl_FragCoord.z * (far-near));
    gl_FragColor  = vec4(normal_n, depth);
}
#endif



varying vec3 Normal;
varying float depth;
void main( void )
{
    //float depth_   = (2.0 * near) / (far + near - gl_FragCoord.z * (far-near));
   gl_FragColor = vec4(normalize(Normal),depth);
   //gl_FragColor = vec4(depth,depth,depth, 1.0);
}
