4 uniform sampler2D distant;
6 #pragma MSP stage(vertex)
9 gl_Position = vec4(vertex.xy, 1.0, 1.0);
10 out vec4 view_dir = eye_clip_matrix*vec4(vertex.xy, -1.0, 1.0);
11 view_dir /= view_dir.w;
12 view_dir = world_eye_matrix*vec4(view_dir.xyz, 0.0);
15 #pragma MSP stage(fragment)
16 layout(location=0) out vec4 frag_color;
19 vec3 nview = normalize(view_dir.xyz);
20 float azimuth = atan(nview.y, nview.x);
21 frag_color = texture(distant, vec2(azimuth/(2*PI), nview.z*0.5+0.5))*light_color;