// Copyright (C) Kimmo Lahtinen - All Rights Reserved

// Input from vertex shader
varying mediump vec2 frag_uv_tile;

// Uniforms
uniform lowp sampler2D uni_texture_tile_map;

float convert_to_bw(vec3 color)
{
	return color.r * 0.299 + color.g * 0.587 + color.b * 0.114;
}

void main(void) 
{
/*
	vec4 color_diffuse = texture2D(uni_texture_tile_map, frag_uv_tile);
	float fow_intensity = texture2D(uni_texture_tile_map, frag_uv_fow).r;

	float bw = convert_to_bw(color_diffuse.rgb);

	vec3 color = mix(color_diffuse.rgb,	vec3(bw), fow_intensity);

	gl_FragColor.rgb = color;
	gl_FragColor.a = color_diffuse.a;
//	gl_FragColor.r = 1.0;
*/
	gl_FragColor = texture2D(uni_texture_tile_map, frag_uv_tile);
}
