mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Better fog
This commit is contained in:
parent
e8aa654f01
commit
d4821b8de8
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,3 +34,4 @@
|
|||||||
settings.ron
|
settings.ron
|
||||||
run.sh
|
run.sh
|
||||||
screenshots
|
screenshots
|
||||||
|
todo.txt
|
||||||
|
@ -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 {
|
if Vec2::<f32>::from(vel.0).magnitude_squared() > 0.1 {
|
||||||
ori.0 = Lerp::lerp(
|
ori.0 = Lerp::lerp(
|
||||||
ori.0,
|
ori.0,
|
||||||
|
@ -139,8 +139,8 @@ vec3 get_sky_color(vec3 dir, float time_of_day) {
|
|||||||
|
|
||||||
float fog(vec2 f_pos, vec2 focus_pos) {
|
float fog(vec2 f_pos, vec2 focus_pos) {
|
||||||
float dist = distance(f_pos, focus_pos) / view_distance.x;
|
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;
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user