varying vec3 normal;

#vertexshader
uniform float blend;

void main()
{
	vec4 posA = gl_ModelViewProjectionMatrix * gl_Vertex;
	vec4 posB = gl_ModelViewProjectionMatrix * gl_MultiTexCoord0;
	normal = gl_Normal;
	//gl_Position = mix(posA, posB, blend);
	gl_Position = mix(posB, posA, blend);


	//gl_Position = ftransform();
	//gl_TexCoord[0] = ;
}

#fragmentshader

void main()
{
	vec3 lightdir = normalize(vec3(1,1,1));
	vec3 color = vec3(1.0,0.7, 0.5);

	float f = (dot(normal, lightdir)+1.0 / 2.2);

	gl_FragColor = vec4(color*(f*0.55+0.45),1.0);
	//float s = scale; //vec2(1.0/512.0, 1.0/512.0);
	/*
	gl_FragColor = (
		texture2DRect(Texture0, gl_TexCoord[0].xy+vec2( 1.0, 0.0)*s) +
		texture2DRect(Texture0, gl_TexCoord[0].xy+vec2(-1.0, 0.0)*s) +
		texture2DRect(Texture0, gl_TexCoord[0].xy+vec2( 0.0, 1.0)*s) +
		texture2DRect(Texture0, gl_TexCoord[0].xy+vec2( 0.0,-1.0)*s)) / 4.0;
		*/

	/*
	gl_FragColor = (
		texture2D(Texture0, gl_TexCoord[0].xy+vec2( 0.5, 0.0)*s) +
		texture2D(Texture0, gl_TexCoord[0].xy+vec2(-0.5, 0.0)*s) +
		texture2D(Texture0, gl_TexCoord[0].xy+vec2( 0.0, 0.5)*s) +
		texture2D(Texture0, gl_TexCoord[0].xy+vec2( 0.0,-0.5)*s)) / 4.0;*/

	//gl_FragColor = texture2D(Texture0, gl_TexCoord[0].xy);
	//gl_FragColor = texture2DRect(gl_TexCoord[0].xy*vec2(1.0/640.0,1.0/480.0),0,0);
	//gl_FragColor = vec4(gl_TexCoord[0].xy,0,0);
}
