varying vec2 		texcoord;
varying vec2		alphacoords;
uniform sampler2D 	tex;
uniform vec4		diffuseColor;
uniform vec2		spec;
//uniform float		alpha;
//uniform vec4		colorMod;	// a = decal life
varying float		fadeAlpha;

void main()
{
	vec3 color=texture2D(tex,texcoord.st).xyz;
	float colorAlpha=texture2D(tex,alphacoords.st).w;
	gl_FragData[0].rgb=color*diffuseColor.xyz;
	gl_FragData[0].a=colorAlpha*fadeAlpha;//*alpha*colorMod.a;
	
	//float glossPow=(fspec.x/512.0)*7.0; //(16*15);
	gl_FragData[1].r=0.0;//(floor(glossPow)*32.0 + floor(fspec.y));//fspec.x;
	gl_FragData[1].g=spec.y*0.00390625;//ffresnel.y;//0.0;//fspec.y;
	gl_FragData[1].b=0.0;
	gl_FragData[1].a=/*0.0*/colorAlpha*fadeAlpha;
}
