source: GTP/trunk/Lib/Illum/GPUObscurancesGT/src/transfer.vert @ 930

Revision 930, 746 bytes checked in by igarcia, 18 years ago (diff)
RevLine 
[930]1uniform float direction;
2
3varying vec2 p1;
4varying vec2 p2;
5varying float factor;
6
7void main()
8{
9        vec4 position = gl_Vertex;
10        vec4 texCoord = gl_MultiTexCoord0;
11        if(((direction == 0) && (position.b != 1.0) && (position.b < 0.0) && ((texCoord.b > 0.0) || (texCoord.b == 1)))
12                || ((direction == 1) && (position.b != 1.0) && (position.b > 0.0) && ((texCoord.b < 0.0) || (texCoord.b == 1))))
13        {
14
15                p1 = vec2(position.r, position.g);
16
17                p2 = vec2(texCoord.r, texCoord.g);
18
19                gl_Position = vec4((p1 * 2.0) - vec2(1.0,1.0), 0.0,1.0);
20                               
21                if (texCoord.b == 1) factor = 1;
22                else factor = abs(texCoord.a - position.a);
23        }
24        else
25        {
26                gl_Position = vec4( 0.0,0.0, 2.0, 1.0 );
27                p1 = p2 = vec2(1.0,1.0);
28                factor = 0.5;
29        }       
30}
Note: See TracBrowser for help on using the repository browser.