2019-10-25 23:42:48 +00:00
|
|
|
#version 120
|
|
|
|
|
|
|
|
varying vec3 vertex;
|
|
|
|
varying vec3 normal;
|
|
|
|
varying vec3 relVec;
|
|
|
|
|
2020-04-04 15:57:33 +00:00
|
|
|
uniform float fg_Fcoef;
|
|
|
|
|
2019-10-25 23:42:48 +00:00
|
|
|
uniform float osg_SimulationTime;
|
|
|
|
uniform float arc_id;
|
|
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
|
|
|
|
normal = gl_Normal;
|
|
|
|
vertex = gl_Vertex.xyz;
|
|
|
|
vec3 ep = (gl_ModelViewMatrixInverse * vec4 (0.0, 0.0, 0.0, 1.0)).xyz;
|
|
|
|
relVec = vertex - ep;
|
|
|
|
|
|
|
|
vec4 vert_out = gl_Vertex;
|
|
|
|
|
|
|
|
float ang = dot(vert_out.xy, vec2 (0.0, 1.0));
|
|
|
|
|
|
|
|
vert_out.x *= (1.0 + 0.05 * sin(ang + 0.1 * osg_SimulationTime + arc_id));
|
|
|
|
vert_out.y *= (1.0 + 0.05 * sin(ang + 0.12 * osg_SimulationTime + arc_id));
|
|
|
|
|
|
|
|
|
|
|
|
gl_Position = gl_ModelViewProjectionMatrix * vert_out;
|
2020-04-04 15:57:33 +00:00
|
|
|
// logarithmic depth
|
|
|
|
gl_Position.z = (log2(max(1e-6, 1.0 + gl_Position.w)) * fg_Fcoef - 1.0) * gl_Position.w;
|
2019-10-25 23:42:48 +00:00
|
|
|
}
|