
#ifdef VERTEX

out vec2 vTexcoord;

void main() {
	gl_Position = ftransform();
	vTexcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).xy;
}

#endif

#ifdef FRAGMENT

/*
const int colortex0Format = RGB16;
*/

uniform sampler2D colortex0;

#include "/lib/Color/Luminance.glsl"


//>>IN-OUT<<//
in vec2 vTexcoord;


void main() {
	
	vec3 vColor = texture2D(colortex0, vTexcoord).rgb; // >>> Main color
	
	
	float vpBrightPart = vpGetLuminance(vColor);

	vec3 vpBright = vpBrightPart > 0.75 ? vColor : vec3(0);

/* DRAWBUFFERS:02 */
	gl_FragData[0] = vec4(vColor, 1.0); //gcolor
	gl_FragData[1] = vec4(vpBright, 1.0);
}
#endif

