map3drendering/Map3DRendering/Shaders/shader.frag
Troispoils b9a2b87fe9 Update for AtlasBuilder ok
Need to improuve duplicate vertex for mapping texture.
2024-02-27 17:04:09 +01:00

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);
}