#ifdef ALPHATEST

	varying vec2 		texcoords;	
	uniform sampler2D 	tex;
	uniform float 		alphalevel;
	
	#ifdef PSYSTEM

		varying float 	life;

	#endif

#endif

varying vec2 depth;	

void main()
{
	gl_FragDepth = (depth.x/depth.y)*0.5 + 0.5;
	
	#ifdef ALPHATEST
		
		#ifdef PSYSTEM
		//	float alpha=texture2D(tex,texcoords.st).a*life;
			//if(alpha<=alphalevel)
			//	discard;
			//else
				gl_FragColor.a = texture2D(tex,texcoords.st).a*life;
		#else
			//float alpha=texture2D(tex,texcoords.st).a;
			//if(alpha<=alphalevel)
			//	discard;
			//else
				gl_FragColor.a = texture2D(tex,texcoords.st).a;
		#endif
		
	#endif
}
