#version 330

out vec4 outputColor;

uniform vec3 viewPos;

in vec4 Color;
in vec4 FarColor;
in vec3 FragPos;

void main()
{
    float distance = length(viewPos - FragPos);
    float interpolationFactor = clamp(distance / 1000, 0.0, 1.0);

    outputColor = mix(Color, FarColor, interpolationFactor);
}