#ifdef VERTEX

out vec2 lmcoord;
out vec2 texcoord;
out vec4 glcolor;
out vec3 vpNormal;


void main() {
	gl_Position = ftransform();
	texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
	lmcoord  = (gl_TextureMatrix[1] * gl_MultiTexCoord1).xy;
	glcolor = gl_Color;
	vpNormal = gl_Normal;


}
#endif


#ifdef FRAGMENT

uniform sampler2D lightmap;
uniform sampler2D texture;

in vec2 lmcoord;
in vec2 texcoord;
in vec4 glcolor;
in vec3 vpNormal;


//>>Matrice<<//
uniform mat4 gbufferModelViewInverse;

//>>UNIFORM VEC3<<//

uniform vec3 shadowLightPosition;

//>>Include<<//
#include "/lib/Conf/Lighting_conf.glsl"
#include "/lib/Lighting/DiffuseLighting.glsl"


void main() {
	vec4 VColor = texture2D(texture, texcoord) * glcolor;
	VColor *= texture2D(lightmap, lmcoord);


	float vpLambertDiffuseLighting = VPdiffuseLighting();

	#ifdef Diffuse_Light
	VColor.rgb *= vpLambertDiffuseLighting;
	#endif	



/* DRAWBUFFERS:0 */
	gl_FragData[0] = VColor; //gcolor
}
#endif