// Vertex Shader for Worldpos Rendering

uniform float mStep;
uniform float mStepLength;
uniform mat4 mNormalizeTrans;
uniform sampler2D mLastLine;
uniform vec3 mExtends;
uniform vec3 mCenterPos;
//uniform sampler2D mVelocity;

void main()
{
	gl_Position = gl_Vertex + vec4(0.0, mStep * 2.0, 0.0, 0.0);

	vec4 lookup = gl_MultiTexCoord0 + vec4(0.0, mStep - mStepLength, 0.0, 0.0);

	vec4 poslookup = texture2D(mLastLine, lookup.xy);

	vec4 texcoord = mNormalizeTrans * poslookup;

	if(poslookup.w == 0.0)
	{
		texcoord.w = 0.0;
	}

	gl_TexCoord[0] = texcoord;
	gl_TexCoord[1] = lookup;
}