19 lines
No EOL
395 B
GLSL
19 lines
No EOL
395 B
GLSL
#version 330
|
|
|
|
out vec4 outputColor;
|
|
|
|
uniform vec3 viewPos;
|
|
uniform sampler2D texture0;
|
|
|
|
in vec4 FarColor;
|
|
in vec3 FragPos;
|
|
in vec2 TexCoord;
|
|
|
|
void main()
|
|
{
|
|
float distance = length(viewPos - FragPos);
|
|
float interpolationFactor = clamp(distance / 1000.0, 0.0, 1.0);
|
|
|
|
vec4 textureColor = texture(texture0, TexCoord);
|
|
outputColor = mix(textureColor, FarColor, interpolationFactor);
|
|
} |