UFO: Alien Invasion
Loading...
Searching...
No Matches
model_low_vs.glsl
Go to the documentation of this file.
1/**
2 * @file
3 * @brief Low quality battlescape model vertex shader.
4 */
5
6uniform float OFFSET;
7uniform int ANIMATE;
8
9/* from includes:
10attribute vec4 NEXT_FRAME_VERTS;
11attribute vec4 NEXT_FRAME_NORMALS;
12attribute vec4 NEXT_FRAME_TANGENTS;
13uniform float TIME;
14
15vec4 Vertex;
16vec3 Normal;
17vec4 Tangent;
18
19varying 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 */
30void 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}