#version 120

uniform sampler2D texture;
uniform sampler2D lightmap;

varying vec4 color;
varying vec4 texcoord;
varying vec4 lmcoord;

varying vec3 normal;


void main() {

	float alpha = texture2D(texture, texcoord.st).a;
	float alphacheck = 0.0f;
	
		if (alpha > 0.9) {
			alphacheck = 1.0f;
		}
		



	gl_FragData[0] = texture2D(texture, texcoord.st) * color;
	gl_FragData[1] = vec4(vec3(gl_FragCoord.z), alphacheck);
	gl_FragData[2] = vec4(normal * 0.5f + 0.5f, alphacheck);
	gl_FragData[4] = vec4(0.0, 0.0, 1.0, alphacheck);
	gl_FragData[5] = vec4(texture2D(lightmap, lmcoord.st).rgb, alphacheck);
	gl_FragData[6] = vec4(0.0f, 0.0f, 0.0f, 1.0f);

}