#ifdef GL_ES
precision highp float;
#endif

attribute vec3 pos_attr;
attribute vec4 color_attr;

uniform mat4 proj_unif;
uniform mat4 modelview_unif;
uniform float  render_mode_flag;
uniform float render_scale;

varying vec4 color;
varying float eyedist;


void main()
{
    vec4 pos = modelview_unif * vec4(pos_attr[0], pos_attr[1], pos_attr[2]*render_scale, 1.0);
    gl_Position = proj_unif * pos;
	float colorV = color_attr[0] * (1.0 - render_mode_flag) + color_attr[1] * render_mode_flag;
    color = vec4(colorV, colorV, colorV, 1.0);
    eyedist = -pos.z;
}

