#version 120

varying vec2 texcoord;
varying vec4 glcolor;
varying float vDepth;

void main() {
    vec4 pos = gl_ModelViewMatrix * gl_Vertex;
    vDepth = clamp(-pos.z / 48.0, 0.0, 1.0);

    gl_Position = gl_ProjectionMatrix * pos;
    texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
    glcolor  = gl_Color;
}
