// $LastChangedDate: 2009-11-25 15:56:38 -0600 (Wed, 25 Nov 2009) $
// Vertex shader (default).

@include inc_vert.glsl

/*****************************************************************************
 * main.
 *****************************************************************************/
void main( void )
{
    // Compute angle (cosine) between VP and surface normal.
    const vec4  ecPosition4     = gl_ModelViewMatrix * gl_Vertex;
    const vec3  ecNormal        = normalize( gl_NormalMatrix * gl_Normal );
    const float cos_VP_surfNorm = dot( normalize(ecNormal), normalize(uni_light0_ecPosition.xyz) );
    const float base            = 0.25;
    var_lightIntensity          = (cos_VP_surfNorm > 0.0) ? base + cos_VP_surfNorm : base;

    // Compute color.
    @include inc_color_vert.glsl

    // Compute fog.
    @include inc_fog_vert.glsl

    // Compute shadow.
    @include inc_shadow_vert.glsl

    // Other outputs.
    gl_Position    = ftransform();
    gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
}
