This commit is contained in:
MihailRis 2026-07-18 16:20:10 +03:00
parent a6c4e9e22e
commit 86096553ce
3 changed files with 15 additions and 4 deletions

View file

@ -7,13 +7,17 @@ uniform float u_weatherFogOpacity;
uniform float u_weatherFogDencity;
uniform float u_weatherFogCurve;
float calc_fog(float depth) {
float calc_fog(float depth, float fogFactor, float fogCurve) {
return min(
1.0,
max(pow(depth * u_fogFactor, u_fogCurve),
max(pow(depth * u_fogFactor * fogFactor, u_fogCurve * fogCurve),
min(pow(depth * u_weatherFogDencity, u_weatherFogCurve),
u_weatherFogOpacity))
);
}
float calc_fog(float depth) {
return calc_fog(depth, 1.0, 1.0);
}
#endif // FOG_GLSL_