VERTEX
varying float NdotL;
varying vec2 pos2;

uniform vec4 sketchOffset;
void main()
{
	vec3 lightDir = normalize(vec3(0.9,1.0,0.1));
	vec3 normal = normalize(gl_NormalMatrix * gl_Normal);
	NdotL = clamp((dot(normal, lightDir) + 0.6)*0.5, 0.0, 1.0);



	
	vec4 p2= gl_ModelViewProjectionMatrix  * gl_Vertex;
	vec4 tpos = gl_ModelViewProjectionMatrix * vec4(0,0,0,1);
	pos2 = ((p2.xy/p2.w)-(tpos.xy/tpos.w))*vec2(1.75,-1.3) + sketchOffset.xy;

 
	gl_TexCoord[0] = gl_MultiTexCoord0;
	gl_Position = p2; 

}
PIXEL

uniform sampler2D tex, tex1;

varying vec2  pos2;
varying float NdotL ;

varying vec2 vPos;
uniform vec4 basecolor;
void main()
{

	vec4 c2 = texture2D(tex1,pos2);
	float v2 = 1.0 - c2.x;

	gl_FragColor = basecolor ;
	gl_FragColor.a = ((v2-NdotL))*10.0 ;
	

	
}
