// $LastChangedDate: 2009-12-14 12:08:18 -0600 (Mon, 14 Dec 2009) $
// Vertex shader (SR-71 Blackbird, high-specular, force dark).

@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 );
        if ( uni_alphaBias )  // assume uni_alphaBias is for SR-71 exhaust flame
        {
            gl_FragColor.a = 0.45;
        }
        else
        {
            gl_FragColor *= gl_Color;
            gl_FragColor.rgb *= var_lightIntensity;
        }
    }

    // Compute shadow.
    @include inc_shadow_frag.glsl

    // Compute fog.
    // (omitted)

    // Compute brightness.
    // (omitted for SR-71)

    // To adjust transparency (exhaust flame).
    gl_FragColor.a += uni_alphaBias;
}
