From 51bb3a986892ae3f8272ab17eab6b0896c5d6c18 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Tue, 25 Nov 2014 13:24:02 +0100 Subject: [PATCH] Changed fog function from exp to linear. --- Shader/phong.fsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shader/phong.fsh b/Shader/phong.fsh index e76524b..4540159 100644 --- a/Shader/phong.fsh +++ b/Shader/phong.fsh @@ -55,7 +55,7 @@ void main() vec3 finalColor = specularColor + diffuseColor + ambientColor; float distanceCameraCenter = distance(cameraCenter, vec3(fragPosition)); float fogFactor = clamp((1.0 - exp(-distanceCameraCenter+fogStart)), 0.0, 1.0); - fogFactor = mix(fogFactor, 0.0, clamp((1.0 - exp(-fragPosition.y+20.0)), 0.0, 1.0)); + fogFactor = mix(fogFactor, 0.0, clamp((fragPosition.y/50.0), 0.0, 1.0)); vec4 texture = texture(uTexture, vTexCoord).rgba; oColor = vec4(finalColor, 1.0f)*texture;