|
|
|
@ -24,16 +24,18 @@ void main() {
|
|
|
|
|
pos_pre = pos.posnrm[gl_VertexIndex][0];
|
|
|
|
|
float zFar = 100.0;
|
|
|
|
|
float zNear = 0.1;
|
|
|
|
|
vec3 cam_orig = offst.xyz;
|
|
|
|
|
vec2 cam_rot = vec2(data[3].w, offst.w);
|
|
|
|
|
gl_Position = pos.posnrm[gl_VertexIndex][0];
|
|
|
|
|
gl_Position.xyz += offst.xyz;
|
|
|
|
|
gl_Position.xyz += cam_orig;
|
|
|
|
|
pos_post = gl_Position;
|
|
|
|
|
mat2 xz_rot;
|
|
|
|
|
xz_rot[0] = vec2(cos(offst.w), -sin(offst.w));
|
|
|
|
|
xz_rot[1] = vec2(sin(offst.w), cos(offst.w));
|
|
|
|
|
xz_rot[0] = vec2(cos(cam_rot.y), -sin(cam_rot.y));
|
|
|
|
|
xz_rot[1] = vec2(sin(cam_rot.y), cos(cam_rot.y));
|
|
|
|
|
gl_Position.xz *= inverse(xz_rot);
|
|
|
|
|
mat2 yz_rot;
|
|
|
|
|
yz_rot[0] = vec2(cos(data[3].w), -sin(data[3].w));
|
|
|
|
|
yz_rot[1] = vec2(sin(data[3].w), cos(data[3].w));
|
|
|
|
|
yz_rot[0] = vec2(cos(cam_rot.x), -sin(cam_rot.x));
|
|
|
|
|
yz_rot[1] = vec2(sin(cam_rot.x), cos(cam_rot.x));
|
|
|
|
|
gl_Position.yz *= inverse(yz_rot);
|
|
|
|
|
gl_Position.x *= (1080.0/1920.0);
|
|
|
|
|
gl_Position.w = (gl_Position.z*sin(140.0/360.0*TAU));
|
|
|
|
|