mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
add 'enable-fog' setting
This commit is contained in:
parent
f5de330f3f
commit
e467c85adc
4 changed files with 10 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue