uniform float2 tex_scale_unif;
uniform float2 tex_offset_unif;
uniform float4x4 proj_unif;
uniform float4x4 modelview_unif;
uniform float render_scale;

void main(	in float2 uv_attr : uv_attr,
			in float3 pos_attr : pos_attr,
			out float4 gl_Position : SV_Position,
			out float2 uv : UV,
			out float eyedist : EYEDIST)
{
	float4 pos = mul(float4(pos_attr.xy, pos_attr.z * render_scale, 1.0f), modelview_unif);
	gl_Position = mul(pos, proj_unif);

	uv = uv_attr * tex_scale_unif + tex_offset_unif;
	eyedist = -pos.z;
	
	return;
}