uniform mat4 modelproj;
in  vec4 pos;
out vec3 dir;
out vec2 texc;
void main()
{
 gl_Position = modelproj*vec4(pos.xyz,1.0);
 dir         = pos.xyz;
 float     c = floor(pos.w+0.00001);
 texc.y      = floor(c*0.5);
 texc.x      = c-texc.y*2.0;
 texc        = (texc-0.5)*2.0;
}