UFO: Alien Invasion
model_low_vs.glsl
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief Low quality battlescape model vertex shader.
4  */
5 
6 uniform float OFFSET;
7 uniform int ANIMATE;
8 
9 /* from includes:
10 attribute vec4 NEXT_FRAME_VERTS;
11 attribute vec4 NEXT_FRAME_NORMALS;
12 attribute vec4 NEXT_FRAME_TANGENTS;
13 uniform float TIME;
14 
15 vec4 Vertex;
16 vec3 Normal;
17 vec4 Tangent;
18 
19 varying float fog;
20 */
21 
22 #include "lerp_vs.glsl"
23 #include "light_vs.glsl"
24 #include "transform_lights_vs.glsl"
25 #include "fog_vs.glsl"
26 
27 /**
28  * @brief Main.
29  */
30 void main(void) {
31  if (ANIMATE > 0) {
32  lerpVertex();
33  } else {
34  Vertex = gl_Vertex;
35  Normal = gl_Normal;
36  Tangent = TANGENTS;
37  }
38 
39  /* MVP transform into clip space.*/
40  gl_Position = ftransform();
41  gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * vec4(Vertex);
42 
43 
44  /* Pass texture coordinate through.*/
45  gl_TexCoord[0] = gl_MultiTexCoord0 + OFFSET;
46 
47  LightVertex();
48 
49  TransformLights();
50 
51 
52 #if r_fog
53  FogVertex();
54 #endif
55 }