From 55d21d145fe8ef57280abe43b32c69fdd525e1ed Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 19 Apr 2021 21:33:52 +0100 Subject: [PATCH 1/4] Made twigs/stones slightly more common --- world/src/layer/scatter.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/world/src/layer/scatter.rs b/world/src/layer/scatter.rs index be3e34b2be..46d4f9f07e 100644 --- a/world/src/layer/scatter.rs +++ b/world/src/layer/scatter.rs @@ -133,10 +133,13 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) { // Collectable Objects // Only spawn twigs in temperate forests (Twigs, false, |c, _| { - ((c.tree_density - 0.5).max(0.0) * 1.0e-3, None) + ( + (c.tree_density * 1.25 - 0.25).powf(0.5).max(0.0) * 0.75e-3, + None, + ) }), (Stones, false, |c, _| { - ((c.rockiness - 0.5).max(0.0) * 1.0e-3, None) + ((c.rockiness - 0.5).max(0.025) * 1.0e-3, None) }), // Don't spawn Mushrooms in snowy regions (Mushroom, false, |c, _| { From 1bfe9f65d6cbdbfc6debe1c2dfabfc8a4aabeccf Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 19 Apr 2021 21:46:51 +0100 Subject: [PATCH 2/4] Fixed block-snapping --- common/sys/src/phys.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/sys/src/phys.rs b/common/sys/src/phys.rs index f090a6aaa6..a719821dc5 100644 --- a/common/sys/src/phys.rs +++ b/common/sys/src/phys.rs @@ -1359,7 +1359,7 @@ fn box_voxel_collision<'a, T: BaseVol + ReadVol>( z_range.clone(), ) && vel.0.z < 0.25 && vel.0.z > -1.5 - && was_on_ground + //&& was_on_ground && block_snap { let snap_height = terrain From f6e71f1e87590e089fe04ba88e78ab9812348f12 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 19 Apr 2021 22:02:47 +0100 Subject: [PATCH 3/4] Fixed negative cloud density bug --- assets/voxygen/shaders/include/cloud/regular.glsl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/voxygen/shaders/include/cloud/regular.glsl b/assets/voxygen/shaders/include/cloud/regular.glsl index e6b5a11a09..682841780f 100644 --- a/assets/voxygen/shaders/include/cloud/regular.glsl +++ b/assets/voxygen/shaders/include/cloud/regular.glsl @@ -53,8 +53,13 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { 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) + 4 * (noise_2d(wind_pos.xy / 20000) - 0.5) - + 1 * (noise_3d(wind_pos / 1000) - 0.5); + #endif + #if (CLOUD_MODE >= CLOUD_MODE_MEDIUM) + + 1 * (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; @@ -76,7 +81,7 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { + 0.5 * (noise_3d(wind_pos / 150.0 / cloud_scale) - 0.5) #endif ) * 0.01; - cloud = pow(cloud, 3) * sign(cloud); + cloud = pow(max(cloud, 0), 3) * 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) From 8f23d476e8e9e78f4c0bc36a4f02b975f80c424a Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 19 Apr 2021 22:26:56 +0100 Subject: [PATCH 4/4] Rebalanced mist --- assets/voxygen/shaders/include/cloud/regular.glsl | 6 +++--- assets/voxygen/shaders/include/sky.glsl | 2 +- common/sys/src/phys.rs | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/assets/voxygen/shaders/include/cloud/regular.glsl b/assets/voxygen/shaders/include/cloud/regular.glsl index 682841780f..ae2d50ce53 100644 --- a/assets/voxygen/shaders/include/cloud/regular.glsl +++ b/assets/voxygen/shaders/include/cloud/regular.glsl @@ -30,7 +30,7 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { #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.00025 * pow(clamp(1.0 - (pos.z - mist_min_alt) / MIST_FADE_HEIGHT, 0.0, 1), 4.0) / (1.0 + pow(1.0 + dist / 20000.0, 2.0)); + 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); @@ -54,10 +54,10 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) { vec3 turb_offset = vec3(1, 1, 0) * time_of_day.x * turb_speed; mist *= 0.5 #if (CLOUD_MODE >= CLOUD_MODE_LOW) - + 4 * (noise_2d(wind_pos.xy / 20000) - 0.5) + + 1.0 * (noise_2d(wind_pos.xy / 5000) - 0.5) #endif #if (CLOUD_MODE >= CLOUD_MODE_MEDIUM) - + 1 * (noise_3d(wind_pos / 1000) - 0.5) + + 0.25 * (noise_3d(wind_pos / 1000) - 0.5) #endif ; diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 8c56bb1fda..b3203e958c 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -85,7 +85,7 @@ float cloud_scale = view_distance.z / 150.0; float cloud_tendency_at(vec2 pos) { float nz = texture(t_noise, (pos + wind_offset) / 60000.0 / cloud_scale).x - 0.3; - nz = pow(clamp(nz, 0, 1), 4); + nz = pow(clamp(nz, 0, 1), 3); return nz; } diff --git a/common/sys/src/phys.rs b/common/sys/src/phys.rs index a719821dc5..f1910a8c15 100644 --- a/common/sys/src/phys.rs +++ b/common/sys/src/phys.rs @@ -1359,7 +1359,6 @@ fn box_voxel_collision<'a, T: BaseVol + ReadVol>( z_range.clone(), ) && vel.0.z < 0.25 && vel.0.z > -1.5 - //&& was_on_ground && block_snap { let snap_height = terrain