// $LastChangedDate: 2009-12-14 13:08:18 -0500 (Mon, 14 Dec 2009) $
// Vertex shader (aircraft, a=color.a).

@include inc_aircraft_frag.glsl

/*****************************************************************************
 * Fragment shader.
 *****************************************************************************/
void main( void )
{
    // Compute fragment from texture and color.
    if ( uni_glass )
    {
        gl_FragColor.rgb = vec3( 0.4, 0.4, 0.4 ) * var_lightIntensity;
        gl_FragColor.a   = 0.6;
    }
    else
    {
        gl_FragColor = texture2D( uni_texture_0, gl_TexCoord[0].st );
        gl_FragColor *= gl_Color;
        gl_FragColor.rgb *= var_lightIntensity;
    }

    // Compute shadow.
    @include inc_shadow_frag.glsl

    // Compute fog.
    @include inc_fog_frag.glsl

    // Adjust transparency (exhaust flame).
    gl_FragColor.a += uni_alphaBias;

    // Compute brightness (final step).
    @include inc_brightness_frag.glsl
}
