clouds and better light beam
[lighthouse] / sdr / beam.v.glsl
1 uniform float beam_len;
2
3 void main()
4 {
5         float dist = gl_Vertex.z;
6         float s = (dist + 1.0) * 1.6;
7
8         vec4 pos = gl_Vertex * vec4(s, s, 1.0, 1.0);
9
10         gl_Position = gl_ModelViewProjectionMatrix * pos;
11
12         float d = dist / beam_len;
13         float falloff = min(1.0 - d, 1.0);
14         gl_FrontColor = vec4(gl_Color.xyz, gl_Color.a * falloff);
15 }