add 'enable-fog' setting

This commit is contained in:
MihailRis 2026-09-26 19:13:08 +03:00
parent f5de330f3f
commit e467c85adc
4 changed files with 10 additions and 0 deletions

View file

@ -8,12 +8,16 @@ uniform float u_weatherFogDencity;
uniform float u_weatherFogCurve;
float calc_fog(float depth, float fogFactor, float fogCurve) {
#ifdef ENABLE_FOG
return min(
1.0,
max(pow(depth * u_fogFactor * fogFactor, u_fogCurve * fogCurve),
min(pow(depth * u_weatherFogDencity, u_weatherFogCurve),
u_weatherFogOpacity))
);
#else
return 0.0;
#endif
}
float calc_fog(float depth) {