Better fog

This commit is contained in:
Joshua Barretto 2019-07-21 00:32:36 +01:00
parent e8aa654f01
commit d4821b8de8
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -34,3 +34,4 @@
settings.ron
run.sh
screenshots
todo.txt

View File

@ -141,7 +141,7 @@ impl<'a> System<'a> for Sys {
}
}
// Set direction based on velocity
// Set direction based on velocity when on the ground
if Vec2::<f32>::from(vel.0).magnitude_squared() > 0.1 {
ori.0 = Lerp::lerp(
ori.0,

View File

@ -139,8 +139,8 @@ vec3 get_sky_color(vec3 dir, float time_of_day) {
float fog(vec2 f_pos, vec2 focus_pos) {
float dist = distance(f_pos, focus_pos) / view_distance.x;
float min_fog = 0.75;
float min_fog = 0.5;
float max_fog = 1.0;
return clamp((dist - min_fog) / (max_fog - min_fog), 0.0, 1.0);
return pow(clamp((dist - min_fog) / (max_fog - min_fog), 0.0, 1.0), 1.7);
}