// Pass 4 (make shadows): vertex program.
void main (float4 pObj          : POSITION,
           out float4 pClip     : POSITION,
           out float4 projRect  : TEXCOORD0,
           uniform float4x4 mvp,
           uniform float4x4 mv,
           uniform float4x4 lightClip)
{
    pClip = mul(mvp, pObj);        // obj -> clip space
    float4 pEye = mul(mv, pObj);   // obj -> eye space

    // Compute RECT projective texture coordinates.
    // lightClip maps camera's eye space to light's
    // clip space, and multiplies x and y by shadow
    // map resolution to yield texRECT coordinates.
    projRect = mul(lightClip, pEye);
}
