VERTEX

varying vec2 pos2;
varying float alpha;
uniform vec4 resScale;
uniform vec4 sketchOffset;

void main()
{



	
	vec4 p2= gl_ModelViewProjectionMatrix  * gl_Vertex;
	vec4 tpos = gl_ModelViewProjectionMatrix * vec4(0,0,0,1);
	pos2 = (-(tpos.xy/tpos.w))*resScale.xy + sketchOffset.xy ;
	alpha = gl_Color.a;

 
	gl_TexCoord[0] = gl_MultiTexCoord0;
	gl_Position = p2; 

}
PIXEL

uniform sampler2D tex, tex1;

varying vec2  pos2;
varying float alpha;
varying vec2 vPos;
uniform vec4 resScale;
uniform vec4 basecolor;
uniform vec4 sketchOffset;
uniform vec4 alphaCol;

void main()
{

	vec4 c = texture2D(tex,gl_TexCoord[0].st) ;

	vec4 c2 = texture2D(tex1,gl_FragCoord.xy*resScale.zw + pos2 );
	float v2 = 1.0 - c2.x;


	float l2 = clamp(((v2-c.x))*10.0 +(c.y*alpha*alpha)*15.0,0.0,1.0) * alpha;
	gl_FragColor =  basecolor * alphaCol;
	gl_FragColor.a = l2;



	
}
