#version 120

#include "lib/defines.glsl"

uniform float blindness;
uniform float frameTimeCounter;
uniform sampler2D noisetex;
uniform sampler2D texture;

varying vec2 lmcoord;
varying vec2 texcoord;
#ifdef RAINBOW_ENCHANTMENTS
	varying vec3 rainbowPos;
#endif
varying vec3 vPosView;
varying vec4 tint;

#include "/lib/noiseres.glsl"

#include "/lib/math.glsl"

#include "/lib/hue.glsl"

struct Position {
	float blockDist; //only used by blindness
};

void main() {
	vec4 color = texture2D(texture, texcoord);

	#include "/lib/rainbowEnchantments.glsl"
	color *= square(lmcoord.x) * 0.5 + 0.5;

	Position pos;
	pos.blockDist = length(vPosView);

	#include "/lib/blindness.glsl"

/* DRAWBUFFERS:0 */
	gl_FragData[0] = color; //gcolor
}