// simple fragment shader

// 'time' contains seconds since the program was linked.
uniform float distort;
varying vec3 nor;
varying vec3 poz;
uniform sampler2D colmap;


void main()
{
	vec2 uv = gl_TexCoord[0].xy;
	vec2 uv2 = poz.xy / vec2(poz.z);
	uv2 = uv2/vec2(2)+vec2(.5);

	vec2 uv3= uv2;
	uv3 += (nor.xy+vec2(nor.z))*vec2(distort);

	vec4 col = texture2D(colmap,uv3);
	//gl_FragColor = gl_Color* col;
	gl_FragColor = col;
}
