

#include "/lib/taa/res_params.glsl"
varying vec4 color;
varying float NdotL;
uniform vec3 atmosphereUp;
flat varying vec3 torch;
varying vec2 lmtexcoord;
uniform ivec2 eyeBrightnessSmooth;
uniform sampler2D texture;

#include "/lib/color_transforms.glsl"
#include "/lib/uniforms.glsl"

/* RENDERTARGETS: 1 */
void main()
{

    vec4 color = texture(texture, lmtexcoord.xy) * color;
    float diffuseSun = mix(0.0, NdotL, min(eyeBrightnessSmooth.y / 240, 1.0));

    color.rgb = toLinear(color.rgb) * (sunLight * diffuseSun + (luma(atmosphereUp) * 2.0) + torch);

    gl_FragData[0] = color;
}
