From 5c469b99d2f629183cd14cc84b3ca3d5ed362450 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 25 Apr 2021 20:04:00 +0100 Subject: [PATCH 1/7] Fixed near cloud bug --- assets/voxygen/shaders/include/cloud/regular.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/voxygen/shaders/include/cloud/regular.glsl b/assets/voxygen/shaders/include/cloud/regular.glsl index ae2d50ce53..00c3de84be 100644 --- a/assets/voxygen/shaders/include/cloud/regular.glsl +++ b/assets/voxygen/shaders/include/cloud/regular.glsl @@ -215,7 +215,7 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of cdist = step_to_dist(trunc(dist_to_step(cdist - 0.25, quality)), quality); vec3 emission; - vec4 sample = cloud_at(origin + (dir + dir_diff / ldist) * ldist * splay, cdist, emission); + vec4 sample = cloud_at(origin + (dir + dir_diff / ldist) * ldist * splay, ldist, emission); vec2 density_integrals = max(sample.zw, vec2(0)) * (ldist - cdist); From d00348cbd2997bb80cc6f29531eae4a469c56058 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 25 Apr 2021 20:06:29 +0100 Subject: [PATCH 2/7] Rebalanced arrow speed --- assets/common/abilities/bow/basic.ron | 2 +- assets/common/abilities/bow/charged.ron | 4 ++-- assets/common/abilities/bow/repeater.ron | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/common/abilities/bow/basic.ron b/assets/common/abilities/bow/basic.ron index 6fdc1a9087..f384fe59de 100644 --- a/assets/common/abilities/bow/basic.ron +++ b/assets/common/abilities/bow/basic.ron @@ -9,5 +9,5 @@ BasicRanged( ), projectile_body: Object(Arrow), projectile_light: None, - projectile_speed: 60.0, + projectile_speed: 120.0, ) diff --git a/assets/common/abilities/bow/charged.ron b/assets/common/abilities/bow/charged.ron index aa2080f578..cdb976a808 100644 --- a/assets/common/abilities/bow/charged.ron +++ b/assets/common/abilities/bow/charged.ron @@ -11,7 +11,7 @@ ChargedRanged( recover_duration: 0.5, projectile_body: Object(MultiArrow), projectile_light: None, - initial_projectile_speed: 60.0, - scaled_projectile_speed: 90.0, + initial_projectile_speed: 120.0, + scaled_projectile_speed: 160.0, move_speed: 0.3, ) diff --git a/assets/common/abilities/bow/repeater.ron b/assets/common/abilities/bow/repeater.ron index e414240342..b0535b23e6 100644 --- a/assets/common/abilities/bow/repeater.ron +++ b/assets/common/abilities/bow/repeater.ron @@ -12,6 +12,6 @@ RepeaterRanged( ), projectile_body: Object(Arrow), projectile_light: None, - projectile_speed: 60.0, + projectile_speed: 120.0, reps_remaining: 3, ) From 4626b7e95dc519189250ad7fc4bb54612a9a15f7 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 25 Apr 2021 22:26:07 +0100 Subject: [PATCH 3/7] More realistic cloud light extinction model --- .../shaders/include/cloud/regular.glsl | 82 ++++++++++--------- assets/voxygen/shaders/include/sky.glsl | 10 +-- 2 files changed, 49 insertions(+), 43 deletions(-) diff --git a/assets/voxygen/shaders/include/cloud/regular.glsl b/assets/voxygen/shaders/include/cloud/regular.glsl index 00c3de84be..6c11be2e3e 100644 --- a/assets/voxygen/shaders/include/cloud/regular.glsl +++ b/assets/voxygen/shaders/include/cloud/regular.glsl @@ -21,18 +21,24 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { // Simulate the atmosphere thinning as you get higher. Not physically accurate, but then // it can't be since Veloren's world is flat, not spherical. float atmosphere_alt = CLOUD_AVG_ALT + 40000.0; - float air = 0.00005 * clamp((atmosphere_alt - pos.z) / 20000, 0, 1); + // Veloren's world is flat. This is, to put it mildly, somewhat non-physical. With the earth as an infinitely-big + // plane, the atmosphere is therefore capable of scattering 100% of any light source at the horizon, no matter how + // bright, because it has to travel through an infinite amount of atmosphere. This doesn't happen in reality + // because the earth has curvature and so there is an upper bound on the amount of atmosphere that a sunset must + // travel through. We 'simulate' this by fading out the atmosphere density with distance. + float flat_earth_hack = 1.0 / (1.0 + dist * 0.0001); + float air = 0.025 * clamp((atmosphere_alt - pos.z) / 20000, 0, 1) * flat_earth_hack; + + float alt = alt_at(pos.xy - focus_off.xy); // Mist sits close to the ground in valleys (TODO: use base_alt to put it closer to water) float mist_min_alt = 0.5; #if (CLOUD_MODE >= CLOUD_MODE_MEDIUM) mist_min_alt = (texture(t_noise, pos.xy / 50000.0).x - 0.5) * 1.5 + 0.5; #endif - mist_min_alt = view_distance.z * 1.5 * (1.0 + mist_min_alt * 0.5); - const float MIST_FADE_HEIGHT = 500; - float mist = 0.0005 * pow(clamp(1.0 - (pos.z - mist_min_alt) / MIST_FADE_HEIGHT, 0.0, 1), 4.0); - - float alt = alt_at(pos.xy - focus_off.xy); + mist_min_alt = view_distance.z * 1.5 * (1.0 + mist_min_alt * 0.5) + alt * 0.5 + 250; + const float MIST_FADE_HEIGHT = 750; + float mist = 0.01 * pow(clamp(1.0 - (pos.z - mist_min_alt) / MIST_FADE_HEIGHT, 0.0, 1), 10.0); vec3 wind_pos = vec3(pos.xy + wind_offset, pos.z + noise_2d(pos.xy / 20000) * 500); @@ -40,6 +46,17 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { float cloud_tendency = cloud_tendency_at(pos.xy); float cloud = 0; + if (mist > 0.0) { + mist *= 0.5 + #if (CLOUD_MODE >= CLOUD_MODE_LOW) + + 1.0 * (noise_2d(wind_pos.xy / 5000) - 0.5) + #endif + #if (CLOUD_MODE >= CLOUD_MODE_MEDIUM) + + 0.25 * (noise_3d(wind_pos / 1000) - 0.5) + #endif + ; + } + //vec2 cloud_attr = get_cloud_heights(wind_pos.xy); float sun_access = 0.0; float moon_access = 0.0; @@ -48,21 +65,13 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { float cloud_broad_a = 0.0; float cloud_broad_b = 0.0; // This is a silly optimisation but it actually nets us a fair few fps by skipping quite a few expensive calcs - if ((pos.z < CLOUD_AVG_ALT + 15000.0 && cloud_tendency > 0.0) || mist > 0.0) { + if ((pos.z < CLOUD_AVG_ALT + 15000.0 && cloud_tendency > 0.0)) { // Turbulence (small variations in clouds/mist) const float turb_speed = -1.0; // Turbulence goes the opposite way vec3 turb_offset = vec3(1, 1, 0) * time_of_day.x * turb_speed; - mist *= 0.5 - #if (CLOUD_MODE >= CLOUD_MODE_LOW) - + 1.0 * (noise_2d(wind_pos.xy / 5000) - 0.5) - #endif - #if (CLOUD_MODE >= CLOUD_MODE_MEDIUM) - + 0.25 * (noise_3d(wind_pos / 1000) - 0.5) - #endif - ; float CLOUD_DEPTH = (view_distance.w - view_distance.z) * 0.8; - const float CLOUD_DENSITY = 5.0; + const float CLOUD_DENSITY = 5000.0; const float CLOUD_ALT_VARI_WIDTH = 100000.0; const float CLOUD_ALT_VARI_SCALE = 5000.0; float cloud_alt = CLOUD_AVG_ALT + alt * 0.5; @@ -75,25 +84,25 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { + 4 * (noise_3d((wind_pos + turb_offset) / 2000.0 / cloud_scale) - 0.5) #endif #if (CLOUD_MODE >= CLOUD_MODE_LOW) - + 0.5 * (noise_3d((wind_pos + turb_offset * 0.5) / 250.0 / cloud_scale) - 0.5) + + 0.75 * (noise_3d((wind_pos + turb_offset * 0.5) / 750.0 / cloud_scale) - 0.5) #endif #if (CLOUD_MODE >= CLOUD_MODE_HIGH) - + 0.5 * (noise_3d(wind_pos / 150.0 / cloud_scale) - 0.5) + + 0.75 * (noise_3d(wind_pos / 500.0 / cloud_scale) - 0.5) #endif ) * 0.01; - cloud = pow(max(cloud, 0), 3) * sign(cloud); + cloud = pow(max(cloud, 0), 4) * sign(cloud); cloud *= CLOUD_DENSITY * (cloud_tendency * 100) * falloff(abs(pos.z - cloud_alt) / CLOUD_DEPTH); // What proportion of sunlight is *not* being blocked by nearby cloud? (approximation) // Basically, just throw together a few values that roughly approximate this term and come up with an average - cloud_sun_access = (clamp(( + cloud_sun_access = exp(( // Cloud density gradient 0.25 * (cloud_broad_a - cloud_broad_b + (0.25 * (noise_3d(wind_pos / 4000 / cloud_scale) - 0.5) + 0.1 * (noise_3d(wind_pos / 1000 / cloud_scale) - 0.5))) #if (CLOUD_MODE >= CLOUD_MODE_HIGH) // More noise + 0.01 * (noise_3d(wind_pos / 500) / cloud_scale - 0.5) #endif - ) * 4.0 - 0.7, -1, 1) + 1.0); + ) * 15.0 - 1.5) * 1.5; // Since we're assuming the sun/moon is always above (not always correct) it's the same for the moon cloud_moon_access = 1.0 - cloud_sun_access; } @@ -114,7 +123,7 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { #endif */ - float mist_sun_access = noise_2d(wind_pos.xy / 10000); + float mist_sun_access = exp(mist); float mist_moon_access = mist_sun_access; sun_access = mix(cloud_sun_access, mist_sun_access, clamp(mist * 20000, 0, 1)); moon_access = mix(cloud_moon_access, mist_moon_access, clamp(mist * 20000, 0, 1)); @@ -126,7 +135,8 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { // Prevent clouds and mist appearing underground (but fade them out gently) float not_underground = clamp(1.0 - (alt - (pos.z - focus_off.z)) / 80.0 + dist * 0.001, 0, 1); - air *= not_underground; + sun_access *= not_underground; + moon_access *= not_underground; float vapor_density = (mist + cloud) * not_underground; if (emission_strength <= 0.0) { @@ -185,14 +195,7 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of // This hack adds a little direction-dependent noise to clouds. It's not correct, but it very cheaply // improves visual quality for low cloud settings float splay = 1.0; - vec3 dir_diff = vec3(0); #if (CLOUD_MODE == CLOUD_MODE_MINIMAL) - /* splay += (texture(t_noise, vec2(atan2(dir.x, dir.y) * 2 / PI, dir.z) * 1.5 - time_of_day * 0.000025).x - 0.5) * 0.4 / (1.0 + pow(dir.z, 2) * 10); */ - /* dir_diff = vec3( */ - /* (texture(t_noise, vec2(atan2(dir.x, dir.y) * 2 / PI, dir.z) * 1.0 - time_of_day * 0.00005).x - 0.5) * 0.2 / (1.0 + pow(dir.z, 2) * 10), */ - /* (texture(t_noise, vec2(atan2(dir.x, dir.y) * 2 / PI, dir.z) * 1.0 - time_of_day * 0.00005).x - 0.5) * 0.2 / (1.0 + pow(dir.z, 2) * 10), */ - /* (texture(t_noise, vec2(atan2(dir.x, dir.y) * 2 / PI, dir.z) * 1.0 - time_of_day * 0.00005).x - 0.5) * 0.2 / (1.0 + pow(dir.z, 2) * 10) */ - /* ) * 1500; */ splay += (texture(t_noise, vec2(atan2(dir.x, dir.y) * 2 / PI, dir.z) * 5.0 - time_of_day * 0.00005).x - 0.5) * 0.025 / (1.0 + pow(dir.z, 2) * 10); #endif @@ -215,22 +218,25 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of cdist = step_to_dist(trunc(dist_to_step(cdist - 0.25, quality)), quality); vec3 emission; - vec4 sample = cloud_at(origin + (dir + dir_diff / ldist) * ldist * splay, ldist, emission); + vec4 sample = cloud_at(origin + dir * ldist * splay, ldist, emission); - vec2 density_integrals = max(sample.zw, vec2(0)) * (ldist - cdist); + vec2 density_integrals = max(sample.zw, vec2(0)); float sun_access = sample.x; float moon_access = sample.y; - float cloud_scatter_factor = 1.0 - 1.0 / (1.0 + clamp(density_integrals.x, 0, 1)); - float global_scatter_factor = 1.0 - 1.0 / (1.0 + clamp(density_integrals.y, 0, 1)); + float cloud_scatter_factor = density_integrals.x; + float global_scatter_factor = density_integrals.y; + + float cloud_darken = pow(1.0 / (1.0 + cloud_scatter_factor), (ldist - cdist) * 0.01); + float global_darken = pow(1.0 / (1.0 + global_scatter_factor), (ldist - cdist) * 0.01); surf_color = // Attenuate light passing through the clouds - surf_color * (1.0 - cloud_scatter_factor - global_scatter_factor) + + surf_color * cloud_darken * global_darken + // Add the directed light light scattered into the camera by the clouds and the atmosphere (global illumination) - get_sun_color() * sun_scatter * get_sun_brightness() * (sun_access * cloud_scatter_factor /*+ sky_color * global_scatter_factor*/) + - get_moon_color() * moon_scatter * get_moon_brightness() * (moon_access * cloud_scatter_factor /*+ sky_color * global_scatter_factor*/) + - sky_light * global_scatter_factor + + get_sun_color() * sun_scatter * get_sun_brightness() * (sun_access * (1.0 - cloud_darken) /*+ sky_color * global_scatter_factor*/) + + get_moon_color() * moon_scatter * get_moon_brightness() * (moon_access * (1.0 - cloud_darken) /*+ sky_color * global_scatter_factor*/) + + sky_light * (1.0 - global_darken) + emission * density_integrals.y; } diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index b3203e958c..817ff012ee 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -25,7 +25,7 @@ const vec3 SKY_DUSK_TOP = vec3(0.06, 0.1, 0.20); const vec3 SKY_DUSK_MID = vec3(0.75, 0.1, 0.15); const vec3 SKY_DUSK_BOT = vec3(0.0, 0.1, 0.23); const vec3 DUSK_LIGHT = vec3(8.0, 1.5, 0.15); -const vec3 SUN_HALO_DUSK = vec3(5.2, 1.0, 0.1); +const vec3 SUN_HALO_DUSK = vec3(10.2, 3.0, 0.1); const vec3 SKY_NIGHT_TOP = vec3(0.001, 0.001, 0.0025); const vec3 SKY_NIGHT_MID = vec3(0.001, 0.005, 0.02); @@ -434,7 +434,7 @@ vec3 get_sky_light(vec3 dir, float time_of_day, bool with_stars) { vec3 sky_mid = mix( mix( SKY_DUSK_MID, SKY_NIGHT_MID, - max(pow(sun_dir.z, 0.2), 0) + max(pow(sun_dir.z, 0.1), 0) ), SKY_DAY_MID, max(-sun_dir.z, 0) @@ -454,7 +454,7 @@ vec3 get_sky_light(vec3 dir, float time_of_day, bool with_stars) { mix( sky_mid, sky_bot, - pow(max(-dir.z, 0), 0.4) + max(-dir.z, 0) ), sky_top, max(dir.z, 0) @@ -474,7 +474,7 @@ vec3 get_sky_color(vec3 dir, float time_of_day, vec3 origin, vec3 f_pos, float q // moon_dir = moon_dir.z <= 0 ? refract(moon_dir/*-view_dir*/, vec3(0.0, 0.0, 1.0), refractionIndex) : moon_dir; // Sun - const vec3 SUN_SURF_COLOR = vec3(1.5, 0.9, 0.35) * 8.0; + const vec3 SUN_SURF_COLOR = vec3(1.5, 0.9, 0.35) * 50.0; vec3 sun_halo_color = mix( SUN_HALO_DUSK, @@ -482,7 +482,7 @@ vec3 get_sky_color(vec3 dir, float time_of_day, vec3 origin, vec3 f_pos, float q pow(max(-sun_dir.z, 0.0), 0.5) ); - vec3 sun_halo = sun_halo_color * 4 * pow(max(dot(dir, -sun_dir), 0), 20.0); + vec3 sun_halo = sun_halo_color * 25 * pow(max(dot(dir, -sun_dir), 0), 20.0); vec3 sun_surf = vec3(0); if (with_features) { float angle = 0.00035; From 2281c6f189ebf8911baf3b0d999c7885435a8801 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 25 Apr 2021 22:37:25 +0100 Subject: [PATCH 4/7] Minor control over velocity when in the air --- common/src/states/utils.rs | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 76dd3d1ac7..b11711a579 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -106,6 +106,8 @@ impl Body { } } + pub fn air_accel(&self) -> f32 { self.base_accel() * 0.025 } + /// Attempt to determine the maximum speed of the character /// when moving on the ground pub fn max_speed_approx(&self) -> f32 { @@ -245,21 +247,21 @@ pub fn handle_move(data: &JoinData, update: &mut StateUpdate, efficiency: f32) { fn basic_move(data: &JoinData, update: &mut StateUpdate, efficiency: f32) { handle_orientation(data, update, efficiency); - if let Some(accel) = data - .physics - .on_ground - .then_some(data.body.base_accel() * efficiency) - { - // Should ability to backpedal be separate from ability to strafe? - update.vel.0 += Vec2::broadcast(data.dt.0) - * accel - * if data.body.can_strafe() { - data.inputs.move_dir - } else { - let fw = Vec2::from(update.ori); - fw * data.inputs.move_dir.dot(fw).max(0.0) - }; - } + let accel = if data.physics.on_ground { + data.body.base_accel() + } else { + data.body.air_accel() + } * efficiency; + + // Should ability to backpedal be separate from ability to strafe? + update.vel.0 += Vec2::broadcast(data.dt.0) + * accel + * if data.body.can_strafe() { + data.inputs.move_dir + } else { + let fw = Vec2::from(update.ori); + fw * data.inputs.move_dir.dot(fw).max(0.0) + }; } /// Handles forced movement From 430d75b67bad308b2f1abdd869e7f654ce3bb26e Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 25 Apr 2021 22:49:20 +0100 Subject: [PATCH 5/7] Capped light access --- assets/voxygen/shaders/include/cloud/regular.glsl | 10 +++++----- assets/voxygen/shaders/include/sky.glsl | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/voxygen/shaders/include/cloud/regular.glsl b/assets/voxygen/shaders/include/cloud/regular.glsl index 6c11be2e3e..79a6709e30 100644 --- a/assets/voxygen/shaders/include/cloud/regular.glsl +++ b/assets/voxygen/shaders/include/cloud/regular.glsl @@ -71,7 +71,7 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { vec3 turb_offset = vec3(1, 1, 0) * time_of_day.x * turb_speed; float CLOUD_DEPTH = (view_distance.w - view_distance.z) * 0.8; - const float CLOUD_DENSITY = 5000.0; + const float CLOUD_DENSITY = 10000.0; const float CLOUD_ALT_VARI_WIDTH = 100000.0; const float CLOUD_ALT_VARI_SCALE = 5000.0; float cloud_alt = CLOUD_AVG_ALT + alt * 0.5; @@ -90,8 +90,8 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { + 0.75 * (noise_3d(wind_pos / 500.0 / cloud_scale) - 0.5) #endif ) * 0.01; - cloud = pow(max(cloud, 0), 4) * sign(cloud); - cloud *= CLOUD_DENSITY * (cloud_tendency * 100) * falloff(abs(pos.z - cloud_alt) / CLOUD_DEPTH); + cloud = pow(max(cloud, 0), 3) * sign(cloud); + cloud *= CLOUD_DENSITY * sqrt(cloud_tendency) * falloff(abs(pos.z - cloud_alt) / CLOUD_DEPTH); // What proportion of sunlight is *not* being blocked by nearby cloud? (approximation) // Basically, just throw together a few values that roughly approximate this term and come up with an average @@ -222,8 +222,8 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of vec2 density_integrals = max(sample.zw, vec2(0)); - float sun_access = sample.x; - float moon_access = sample.y; + float sun_access = max(sample.x, 0); + float moon_access = max(sample.y, 0); float cloud_scatter_factor = density_integrals.x; float global_scatter_factor = density_integrals.y; diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 817ff012ee..41ac27e511 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -410,7 +410,7 @@ float is_star_at(vec3 dir) { //return 0.0; - return 1.0 / (1.0 + pow(dist * 750, 8)); + return 5.0 / (1.0 + pow(dist * 750, 8)); } vec3 get_sky_light(vec3 dir, float time_of_day, bool with_stars) { @@ -491,8 +491,8 @@ vec3 get_sky_color(vec3 dir, float time_of_day, vec3 origin, vec3 f_pos, float q vec3 sun_light = sun_halo + sun_surf; // Moon - const vec3 MOON_SURF_COLOR = vec3(0.7, 1.0, 1.5) * 20.0; - const vec3 MOON_HALO_COLOR = vec3(0.015, 0.015, 0.05) * 48; + const vec3 MOON_SURF_COLOR = vec3(0.7, 1.0, 1.5) * 250.0; + const vec3 MOON_HALO_COLOR = vec3(0.015, 0.015, 0.05) * 250; vec3 moon_halo_color = MOON_HALO_COLOR; vec3 moon_halo = moon_halo_color * pow(max(dot(dir, -moon_dir), 0), 100.0); From 9bba3acfbe5d8adc54ec454a882978b0c4cde897 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 25 Apr 2021 23:00:30 +0100 Subject: [PATCH 6/7] Don't use movement efficiency for orientation --- common/src/states/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index b11711a579..8cfd9e47db 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -245,7 +245,7 @@ pub fn handle_move(data: &JoinData, update: &mut StateUpdate, efficiency: f32) { /// Updates components to move player as if theyre on ground or in air #[allow(clippy::assign_op_pattern)] // TODO: Pending review in #587 fn basic_move(data: &JoinData, update: &mut StateUpdate, efficiency: f32) { - handle_orientation(data, update, efficiency); + handle_orientation(data, update, 1.0); let accel = if data.physics.on_ground { data.body.base_accel() From a785fb13a8cf3d8aa113ddb19f25cccbfd4d75c3 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 25 Apr 2021 23:28:19 +0100 Subject: [PATCH 7/7] Apply flat earth hack to mist --- assets/voxygen/shaders/include/cloud/regular.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/voxygen/shaders/include/cloud/regular.glsl b/assets/voxygen/shaders/include/cloud/regular.glsl index 79a6709e30..3e11d10810 100644 --- a/assets/voxygen/shaders/include/cloud/regular.glsl +++ b/assets/voxygen/shaders/include/cloud/regular.glsl @@ -37,8 +37,8 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { mist_min_alt = (texture(t_noise, pos.xy / 50000.0).x - 0.5) * 1.5 + 0.5; #endif mist_min_alt = view_distance.z * 1.5 * (1.0 + mist_min_alt * 0.5) + alt * 0.5 + 250; - const float MIST_FADE_HEIGHT = 750; - float mist = 0.01 * pow(clamp(1.0 - (pos.z - mist_min_alt) / MIST_FADE_HEIGHT, 0.0, 1), 10.0); + const float MIST_FADE_HEIGHT = 1000; + float mist = 0.01 * pow(clamp(1.0 - (pos.z - mist_min_alt) / MIST_FADE_HEIGHT, 0.0, 1), 10.0) * flat_earth_hack; vec3 wind_pos = vec3(pos.xy + wind_offset, pos.z + noise_2d(pos.xy / 20000) * 500);