mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Tweaked lighting and AO
This commit is contained in:
parent
e671d8473c
commit
fa8f3a4b49
@ -28,9 +28,9 @@ void main() {
|
|||||||
f_norm = vec3(0.0, 0.0, 1.0) * norm_dir;
|
f_norm = vec3(0.0, 0.0, 1.0) * norm_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
float glob_ambience = 0.001;
|
float glob_ambience = 0.0005;
|
||||||
|
|
||||||
float sun_ambience = 0.9;
|
float sun_ambience = 0.8;
|
||||||
|
|
||||||
vec3 sun_dir = normalize(vec3(1.3, 1.7, 2.1));
|
vec3 sun_dir = normalize(vec3(1.3, 1.7, 2.1));
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ fn create_quad<P: Pipeline, F: Fn(Vec3<f32>, Vec3<f32>, Rgb<f32>) -> P::Vertex>(
|
|||||||
let ao_scale = 0.95;
|
let ao_scale = 0.95;
|
||||||
let dark = col * (1.0 - ao_scale);
|
let dark = col * (1.0 - ao_scale);
|
||||||
|
|
||||||
let ao_map = ao.map(|e| e.powf(1.5));
|
let ao_map = ao.map(|e| 0.15 + e.powf(2.0) * 0.85);
|
||||||
|
|
||||||
if ao[0].min(ao[2]) < ao[1].min(ao[3]) {
|
if ao[0].min(ao[2]) < ao[1].min(ao[3]) {
|
||||||
Quad::new(
|
Quad::new(
|
||||||
|
@ -107,7 +107,7 @@ impl<'a> Sampler for BlockGen<'a> {
|
|||||||
let water = Block::new(1, Rgb::new(100, 150, 255));
|
let water = Block::new(1, Rgb::new(100, 150, 255));
|
||||||
let warm_stone = Block::new(1, Rgb::new(165, 165, 130));
|
let warm_stone = Block::new(1, Rgb::new(165, 165, 130));
|
||||||
|
|
||||||
let block = if (wposf.z as f32) < height - 2.0 {
|
let block = if (wposf.z as f32) < height - 3.0 {
|
||||||
// Underground
|
// Underground
|
||||||
if (wposf.z as f32) > alt {
|
if (wposf.z as f32) > alt {
|
||||||
Some(surface_stone)
|
Some(surface_stone)
|
||||||
|
@ -4,6 +4,6 @@ pub struct Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub const CONFIG: Config = Config {
|
pub const CONFIG: Config = Config {
|
||||||
sea_level: 128.0,
|
sea_level: 140.0,
|
||||||
mountain_scale: 1200.0,
|
mountain_scale: 1200.0,
|
||||||
};
|
};
|
||||||
|
1
world/src/sim/location.rs
Normal file
1
world/src/sim/location.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
pub struct Location;
|
@ -1,4 +1,9 @@
|
|||||||
use std::ops::{Add, Div, Mul, Neg, Sub};
|
mod location;
|
||||||
|
|
||||||
|
use std::{
|
||||||
|
ops::{Add, Div, Mul, Neg, Sub},
|
||||||
|
sync::Arc,
|
||||||
|
};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
use noise::{
|
use noise::{
|
||||||
BasicMulti, RidgedMulti, SuperSimplex, HybridMulti,
|
BasicMulti, RidgedMulti, SuperSimplex, HybridMulti,
|
||||||
@ -12,6 +17,7 @@ use crate::{
|
|||||||
CONFIG,
|
CONFIG,
|
||||||
util::StructureGen2d,
|
util::StructureGen2d,
|
||||||
};
|
};
|
||||||
|
use self::location::Location;
|
||||||
|
|
||||||
pub const WORLD_SIZE: Vec2<usize> = Vec2 { x: 1024, y: 1024 };
|
pub const WORLD_SIZE: Vec2<usize> = Vec2 { x: 1024, y: 1024 };
|
||||||
|
|
||||||
@ -73,11 +79,19 @@ impl WorldSim {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Self {
|
let mut this = Self {
|
||||||
seed,
|
seed,
|
||||||
chunks,
|
chunks,
|
||||||
gen_ctx,
|
gen_ctx,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
this.simulate(100);
|
||||||
|
|
||||||
|
this
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn simulate(&mut self, cycles: usize) {
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get(&self, chunk_pos: Vec2<u32>) -> Option<&SimChunk> {
|
pub fn get(&self, chunk_pos: Vec2<u32>) -> Option<&SimChunk> {
|
||||||
@ -152,6 +166,7 @@ pub struct SimChunk {
|
|||||||
pub rockiness: f32,
|
pub rockiness: f32,
|
||||||
pub cliffiness: f32,
|
pub cliffiness: f32,
|
||||||
pub tree_density: f32,
|
pub tree_density: f32,
|
||||||
|
pub location: Option<Arc<Location>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SimChunk {
|
impl SimChunk {
|
||||||
@ -222,6 +237,7 @@ impl SimChunk {
|
|||||||
.mul(1.0 - chaos * 0.85)
|
.mul(1.0 - chaos * 0.85)
|
||||||
.add(0.1)
|
.add(0.1)
|
||||||
.mul(if alt > CONFIG.sea_level + 2.0 { 1.0 } else { 0.0 }),
|
.mul(if alt > CONFIG.sea_level + 2.0 { 1.0 } else { 0.0 }),
|
||||||
|
location: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user