Merge branch 'zesterer/small-fixes' into 'master'

Small fixes

See merge request veloren/veloren!2163
This commit is contained in:
Joshua Barretto 2021-04-19 21:54:26 +00:00
commit c5455fa1a1
4 changed files with 15 additions and 8 deletions

View File

@ -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);
@ -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
+ 4 * (noise_2d(wind_pos.xy / 20000) - 0.5)
+ 1 * (noise_3d(wind_pos / 1000) - 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;
@ -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)

View File

@ -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;
}

View File

@ -1359,7 +1359,6 @@ fn box_voxel_collision<'a, T: BaseVol<Vox = Block> + ReadVol>(
z_range.clone(),
) && vel.0.z < 0.25
&& vel.0.z > -1.5
&& was_on_ground
&& block_snap
{
let snap_height = terrain

View File

@ -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, _| {