#version 400

varying vec4 vpos;

















precision highp float;
#define MAX_LIGHTS 14
in vec3 alightVec[MAX_LIGHTS];
in vec3 aeyeVec[MAX_LIGHTS];
in vec2 texCoord;

uniform vec4 glColor;



uniform float lightsEnabled[MAX_LIGHTS];
uniform float lightsinvRadius[MAX_LIGHTS];
uniform float lightMapSelect[MAX_LIGHTS];


uniform float lightsAmbientr[MAX_LIGHTS];
uniform float lightsAmbientg[MAX_LIGHTS];
uniform float lightsAmbientb[MAX_LIGHTS];

uniform float lightsDiffuser[MAX_LIGHTS];
uniform float lightsDiffuseg[MAX_LIGHTS];
uniform float lightsDiffuseb[MAX_LIGHTS];

uniform float lightsSpecularr[MAX_LIGHTS];
uniform float lightsSpecularg[MAX_LIGHTS];
uniform float lightsSpecularb[MAX_LIGHTS];



uniform sampler2D colorMap;
uniform sampler2D normalMap;
uniform sampler2D lightMap;
uniform sampler2D specularMap;



void main (void)
{

    vec3 lightVec;
    vec3 eyeVec;
    vec4 accvDiffuse = vec4(0.0);
    vec4 accvSpecular = vec4(0.0);
    float distSqr;
    vec3 lVec;
    vec3 vVec;
    float att;
    vec4 base;
    vec4 vAmbient;
    vec3 bump;
    float diffuse;
    vec4 vDiffuse;
    vec4 vSpecular;
    float specular;
    vec3 nrmltexture;

    base = texture2D(colorMap, texCoord);
    
    vAmbient = vec4(1.0f,1.0f,1.0f,1.0f)
               * vec4(lightsAmbientr[0],lightsAmbientg[0],lightsAmbientb[0],1.0f);

















    

    
        
        
        gl_FragColor = vec4(vec3(gl_FragCoord.w),1.0f);










    float depth=vpos.z/200.0f;
    double x2=depth*(65536*256);
    double r2=floor(x2/(65536)); x2=x2-r2*(65536);
    double g2=floor(x2/(256)); x2=x2-g2*(256);
    double b2=floor(x2/(1)); x2=x2-b2*(1);
    
    float r1=float(r2/256.0f);
    float g1=float(g2/256.0f);
    float b1=float(b2/256.0f);
    

    
    gl_FragColor = vec4(r1,g1,b1,1.0f);
    





    

    

    
    
    
}











