/*
 * Copyright (C) 2011 guest(r) - guest.r@gmail.com
 *
 */

uniform vec4 OGL2InvSize;
 
void main()
{
    float x = OGL2InvSize.x*0.25;
    float y = OGL2InvSize.y*0.25;
    vec2 dg1 = vec2( x,y);
    vec2 dg2 = vec2(-x,y);
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
    gl_TexCoord[1].xy = gl_TexCoord[0].xy - dg1;
    gl_TexCoord[2].xy = gl_TexCoord[0].xy - dg2;
    gl_TexCoord[3].xy = gl_TexCoord[0].xy + dg1;
    gl_TexCoord[4].xy = gl_TexCoord[0].xy + dg2;
}