mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'zesterer/small-fixes' into 'master'
Minor Tweaks See merge request veloren/veloren!560
This commit is contained in:
commit
6e59571637
@ -21,7 +21,7 @@ uniform u_shadows {
|
|||||||
|
|
||||||
vec3 illuminate(vec3 color, vec3 light, vec3 diffuse, vec3 ambience) {
|
vec3 illuminate(vec3 color, vec3 light, vec3 diffuse, vec3 ambience) {
|
||||||
float avg_col = (color.r + color.g + color.b) / 3.0;
|
float avg_col = (color.r + color.g + color.b) / 3.0;
|
||||||
return ((color - avg_col) * light + (diffuse + ambience) * avg_col) * diffuse;
|
return ((color - avg_col) * light + (diffuse + ambience) * avg_col) * (diffuse + ambience);
|
||||||
}
|
}
|
||||||
|
|
||||||
float attenuation_strength(vec3 rpos) {
|
float attenuation_strength(vec3 rpos) {
|
||||||
|
@ -31,11 +31,11 @@ vec3 get_sun_dir(float time_of_day) {
|
|||||||
const float PERSISTENT_AMBIANCE = 0.1;
|
const float PERSISTENT_AMBIANCE = 0.1;
|
||||||
|
|
||||||
float get_sun_brightness(vec3 sun_dir) {
|
float get_sun_brightness(vec3 sun_dir) {
|
||||||
return max(-sun_dir.z + 0.6, 0.0) * 0.8;
|
return max(-sun_dir.z + 0.6, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_sun_diffuse(vec3 norm, float time_of_day, out vec3 light, out vec3 diffuse_light, out vec3 ambient_light) {
|
void get_sun_diffuse(vec3 norm, float time_of_day, out vec3 light, out vec3 diffuse_light, out vec3 ambient_light) {
|
||||||
const float SUN_AMBIANCE = 0.1;
|
const float SUN_AMBIANCE = 0.0;
|
||||||
|
|
||||||
vec3 sun_dir = get_sun_dir(time_of_day);
|
vec3 sun_dir = get_sun_dir(time_of_day);
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ impl<'a> BlockGen<'a> {
|
|||||||
cliff_hill,
|
cliff_hill,
|
||||||
close_cliffs,
|
close_cliffs,
|
||||||
temp,
|
temp,
|
||||||
|
humidity,
|
||||||
chunk,
|
chunk,
|
||||||
..
|
..
|
||||||
} = sample;
|
} = sample;
|
||||||
@ -265,9 +265,10 @@ impl<'a> BlockGen<'a> {
|
|||||||
} else if (wposf.z as f32) < height + 0.9
|
} else if (wposf.z as f32) < height + 0.9
|
||||||
&& temp < CONFIG.desert_temp
|
&& temp < CONFIG.desert_temp
|
||||||
&& (wposf.z as f32 > water_height + 3.0)
|
&& (wposf.z as f32 > water_height + 3.0)
|
||||||
&& marble > 0.68
|
&& marble > 0.6
|
||||||
&& marble_small > 0.65
|
&& marble_small > 0.55
|
||||||
&& (marble * 3173.7).fract() < 0.5
|
&& (marble * 3173.7).fract() < 0.6
|
||||||
|
&& humidity > 0.4
|
||||||
{
|
{
|
||||||
let flowers = [
|
let flowers = [
|
||||||
BlockKind::BlueFlower,
|
BlockKind::BlueFlower,
|
||||||
@ -287,10 +288,10 @@ impl<'a> BlockGen<'a> {
|
|||||||
];
|
];
|
||||||
|
|
||||||
Some(Block::new(
|
Some(Block::new(
|
||||||
if (height * 1271.0).fract() < 0.15 {
|
if (height * 1271.0).fract() < 0.1 {
|
||||||
flowers[(height * 0.2) as usize % flowers.len()]
|
flowers[(height * 0.2) as usize % flowers.len()]
|
||||||
} else {
|
} else {
|
||||||
grasses[(height * 0.3) as usize % grasses.len()]
|
grasses[(height * 103.3) as usize % grasses.len()]
|
||||||
},
|
},
|
||||||
Rgb::broadcast(0),
|
Rgb::broadcast(0),
|
||||||
))
|
))
|
||||||
@ -563,7 +564,7 @@ pub fn block_from_structure(
|
|||||||
let field = RandomField::new(structure_seed + 0);
|
let field = RandomField::new(structure_seed + 0);
|
||||||
|
|
||||||
let lerp = 0.5
|
let lerp = 0.5
|
||||||
+ ((field.get(Vec3::from(structure_pos)) % 256) as f32 / 256.0 - 0.5) * 0.65
|
+ ((field.get(Vec3::from(structure_pos)) % 256) as f32 / 256.0 - 0.5) * 0.85
|
||||||
+ ((field.get(Vec3::from(pos)) % 256) as f32 / 256.0 - 0.5) * 0.15;
|
+ ((field.get(Vec3::from(pos)) % 256) as f32 / 256.0 - 0.5) * 0.15;
|
||||||
|
|
||||||
match sblock {
|
match sblock {
|
||||||
|
@ -221,8 +221,8 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
|
|||||||
|
|
||||||
// Colours
|
// Colours
|
||||||
let cold_grass = Rgb::new(0.0, 0.5, 0.25);
|
let cold_grass = Rgb::new(0.0, 0.5, 0.25);
|
||||||
let warm_grass = Rgb::new(0.03, 0.8, 0.0);
|
let warm_grass = Rgb::new(0.4, 0.8, 0.0);
|
||||||
let dark_grass = Rgb::new(0.01, 0.3, 0.0);
|
let dark_grass = Rgb::new(0.15, 0.4, 0.1);
|
||||||
let wet_grass = Rgb::new(0.1, 0.8, 0.2);
|
let wet_grass = Rgb::new(0.1, 0.8, 0.2);
|
||||||
let cold_stone = Rgb::new(0.57, 0.67, 0.8);
|
let cold_stone = Rgb::new(0.57, 0.67, 0.8);
|
||||||
let warm_stone = Rgb::new(0.77, 0.77, 0.64);
|
let warm_stone = Rgb::new(0.77, 0.77, 0.64);
|
||||||
@ -513,6 +513,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
|
|||||||
cliff_hill,
|
cliff_hill,
|
||||||
close_cliffs: sim.gen_ctx.cliff_gen.get(wpos),
|
close_cliffs: sim.gen_ctx.cliff_gen.get(wpos),
|
||||||
temp,
|
temp,
|
||||||
|
humidity,
|
||||||
spawn_rate,
|
spawn_rate,
|
||||||
location: sim_chunk.location.as_ref(),
|
location: sim_chunk.location.as_ref(),
|
||||||
|
|
||||||
@ -548,6 +549,7 @@ pub struct ColumnSample<'a> {
|
|||||||
pub cliff_hill: f32,
|
pub cliff_hill: f32,
|
||||||
pub close_cliffs: [(Vec2<i32>, u32); 9],
|
pub close_cliffs: [(Vec2<i32>, u32); 9],
|
||||||
pub temp: f32,
|
pub temp: f32,
|
||||||
|
pub humidity: f32,
|
||||||
pub spawn_rate: f32,
|
pub spawn_rate: f32,
|
||||||
pub location: Option<&'a LocationInfo>,
|
pub location: Option<&'a LocationInfo>,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user