Addressed review comments

This commit is contained in:
Joshua Barretto 2020-11-21 21:31:49 +00:00
parent df1b19ed64
commit 8fd2e4537d
8 changed files with 14 additions and 4 deletions

View File

@ -20,7 +20,8 @@ float emission_strength = clamp((sin(time_of_day.x / (3600 * 24)) - 0.8) / 0.1,
// Returns vec4(r, g, b, density)
vec4 cloud_at(vec3 pos, float dist, out vec3 emission) {
// Natural attenuation of air (air naturally attenuates light that passes through it)
// Simulate the atmosphere thinning above 3000 metres down to nothing at 5000 metres
// 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 air = 0.00035 * clamp((10000.0 - pos.z) / 7000, 0, 1);
// Mist sits close to the ground in valleys (TODO: use base_alt to put it closer to water)

View File

@ -44,7 +44,8 @@ const float UNDERWATER_MIST_DIST = 100.0;
const float PERSISTENT_AMBIANCE = 1.0 / 32.0;// 1.0 / 80; // 1.0 / 512; // 0.00125 // 0.1;// 0.025; // 0.1;
const vec3 GLOW_COLOR = vec3(1, 0.35, 0.05);
// Allowed to be > 1 due to HDR
const vec3 GLOW_COLOR = vec3(2, 1.30, 0.1);
//vec3 get_sun_dir(float time_of_day) {
// const float TIME_FACTOR = (PI * 2.0) / (3600.0 * 24.0);

View File

@ -206,7 +206,7 @@ void main() {
// Tonemapping
float exposure_offset = 1.0;
// Adding an in-code offset to gamma and explosure let us have more precise control over the game's look
// Adding an in-code offset to gamma and exposure let us have more precise control over the game's look
float gamma_offset = 0.3;
aa_color.rgb = vec3(1.0) - exp(-aa_color.rgb * (gamma_exposure.y + exposure_offset));
// gamma correction

View File

@ -142,6 +142,8 @@ void main() {
// f_pos = v_pos + (model_offs - focus_off.xyz);
f_pos = (inst_mat * vec4(v_pos_, 1.0)).xyz * SCALE + inst_offs;
// Terrain 'pop-in' effect
f_pos.z -= 250.0 * (1.0 - min(1.0001 - 0.02 / pow(tick.x - load_time, 10.0), 1.0));
// f_pos = (inst_mat * v_pos_) * SCALE + sprite_pos;

View File

@ -75,6 +75,8 @@ void main() {
f_pos = f_chunk_pos + model_offs - focus_off.xyz;
f_load_time = load_time;
// Terrain 'pop-in' effect
f_pos.z -= 250.0 * (1.0 - min(1.0001 - 0.02 / pow(tick.x - load_time, 10.0), 1.0));
// f_pos.z -= min(32.0, 25.0 * pow(distance(focus_pos.xy, f_pos.xy) / view_distance.x, 20.0));

View File

@ -27,6 +27,7 @@ use rand::Rng;
/// .build();
/// ```
#[derive(Copy, Clone)]
pub enum LoadoutConfig {
Guard,
Cultist,

View File

@ -181,6 +181,9 @@ impl Block {
.unwrap_or(true)
}
/// Can this block be exploded? If so, what 'power' is required to do so?
/// Note that we don't really define what 'power' is. Consider the units
/// arbitrary and only important when compared to one-another.
#[inline]
pub fn explode_power(&self) -> Option<f32> {
match self.kind() {

View File

@ -434,7 +434,7 @@ fn handle_time(
Ok(n) => n,
Err(_) => match NaiveTime::parse_from_str(n, "%H:%M") {
Ok(time) => time.num_seconds_from_midnight() as f64,
// Accept `u12345`, seconds since midnight day 0`
// Accept `u12345`, seconds since midnight day 0
Err(_) => match n
.get(1..)
.filter(|_| n.chars().next() == Some('u'))