Debian Codegraph @

Shaders/planet-aurora.vert

raw
1 #version 120
2
3 varying vec3 vertex;
4 varying vec3 normal;
5 varying vec3 relVec;
6
7 uniform float osg_SimulationTime;
8 uniform float arc_id;
9
10
11 void main()
12 {
13
14 normal = gl_Normal;
15 vertex = gl_Vertex.xyz;
16 vec3 ep = (gl_ModelViewMatrixInverse * vec4 (0.0, 0.0, 0.0, 1.0)).xyz;
17 relVec = vertex - ep;
18
19 vec4 vert_out = gl_Vertex;
20
21 float ang = dot(vert_out.xy, vec2 (0.0, 1.0));
22
23 vert_out.x *= (1.0 + 0.05 * sin(ang + 0.1 * osg_SimulationTime + arc_id));
24 vert_out.y *= (1.0 + 0.05 * sin(ang + 0.12 * osg_SimulationTime + arc_id));
25
26
27 gl_Position = gl_ModelViewProjectionMatrix * vert_out;
28 }