From 98fa5e0c4e0af918af675511c3c3b15b5ee7b14c Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 29 Sep 2021 19:25:04 +0200 Subject: [PATCH] Night fog color --- shaders/3d/fragment.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shaders/3d/fragment.glsl b/shaders/3d/fragment.glsl index f69fb49..b419eaa 100755 --- a/shaders/3d/fragment.glsl +++ b/shaders/3d/fragment.glsl @@ -21,7 +21,7 @@ vec3 hsv2rgb(vec3 c) void main() { vec3 lightColor = vec3(1.0); - vec3 fogColor = vec3(0x87, 0xCE, 0xEB) / vec3(0xFF); + vec3 fogColor = mix(vec3(0x03, 0x0A, 0x1A), vec3(0x87, 0xCE, 0xEB), daylight) / vec3(0xFF); float ambientStrength = mix(0.3, 0.7, daylight); @@ -31,5 +31,5 @@ void main() vec3 light = ambient + diffuse; outColor = texture(textures[int(fragmentTextureIndex + 0.5)], fragmentTextureCoords) * vec4(hsv2rgb(vec3(fragmentColor)), 1.0) * vec4(light, 1.0); - outColor.rgb = mix(outColor.rgb, ambientStrength * vec3(fogColor), clamp(length(fragmentPosition - cameraPos) / 255.0, 0.0, 1.0)); + outColor.rgb = mix(outColor.rgb, ambientStrength * fogColor, clamp(length(fragmentPosition - cameraPos) / 255.0, 0.0, 1.0)); } -- 2.44.0