1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Allow fog color to be overriden properly (#14296)

This commit is contained in:
sfan5 2024-01-23 22:33:33 +01:00 committed by GitHub
parent a29d3cf074
commit 9e3a11534f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 96 additions and 84 deletions

View file

@ -1,7 +1,7 @@
uniform sampler2D baseTexture;
uniform vec3 dayLight;
uniform vec4 skyBgColor;
uniform vec4 fogColor;
uniform float fogDistance;
uniform float fogShadingParameter;
uniform vec3 eyePosition;
@ -448,7 +448,7 @@ void main(void)
// Note: clarity = (1 - fogginess)
float clarity = clamp(fogShadingParameter
- fogShadingParameter * length(eyeVec) / fogDistance, 0.0, 1.0);
col = mix(skyBgColor, col, clarity);
col = mix(fogColor, col, clarity);
col = vec4(col.rgb, base.a);
gl_FragData[0] = col;

View file

@ -1,7 +1,7 @@
uniform sampler2D baseTexture;
uniform vec3 dayLight;
uniform vec4 skyBgColor;
uniform vec4 fogColor;
uniform float fogDistance;
uniform float fogShadingParameter;
uniform vec3 eyePosition;
@ -449,7 +449,7 @@ void main(void)
// Note: clarity = (1 - fogginess)
float clarity = clamp(fogShadingParameter
- fogShadingParameter * length(eyeVec) / fogDistance, 0.0, 1.0);
col = mix(skyBgColor, col, clarity);
col = mix(fogColor, col, clarity);
col = vec4(col.rgb, base.a);
gl_FragData[0] = col;