// $LastChangedDate: 2009-05-22 16:47:41 -0500 (Fri, 22 May 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 shadow.
    @include inc_shadow_vert.glsl

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