
#ifdef GL_ES
precision highp float;
#endif

attribute vec2 pos_attr;
attribute vec2 uv_attr;
attribute vec2 vector_offset_attr;
attribute vec2 vector_shift_attr;

uniform mat4 proj_unif;
uniform mat4 modelview_unif;

uniform float edge_width_multiplier;
uniform float edge_shift_multiplier;

uniform float texture_x_offset;
uniform float texture_x_divisor;

varying vec2 uv;
varying float eyedist;

void main()
{
    vec2 shifted_pos = pos_attr+(vector_offset_attr*edge_width_multiplier)+(vector_shift_attr*edge_shift_multiplier);

    vec4 pos = modelview_unif * vec4(shifted_pos, 0.0, 1.0);
    gl_Position = proj_unif * pos;

    //use divisor to maintain relationship between texture width and texture height
    uv = vec2((uv_attr[0]/texture_x_divisor)+texture_x_offset, uv_attr[1]);
  
    eyedist = -pos.z;
}

