mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Reenabled towns, lighter days
This commit is contained in:
parent
61568eac7c
commit
6fc2096dae
@ -3,7 +3,7 @@ const float PI = 3.141592;
|
||||
const vec3 SKY_DAY_TOP = vec3(0.2, 0.3, 0.9);
|
||||
const vec3 SKY_DAY_MID = vec3(0.15, 0.2, 0.8);
|
||||
const vec3 SKY_DAY_BOT = vec3(0.02, 0.1, 0.3);
|
||||
const vec3 DAY_LIGHT = vec3(0.5, 0.5, 0.8);
|
||||
const vec3 DAY_LIGHT = vec3(0.5, 0.5, 1.0);
|
||||
|
||||
const vec3 SKY_DUSK_TOP = vec3(0.1, 0.15, 0.3);
|
||||
const vec3 SKY_DUSK_MID = vec3(0.9, 0.3, 0.2);
|
||||
@ -25,7 +25,7 @@ vec3 get_sun_dir(float time_of_day) {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
const float PERSISTENT_AMBIANCE = 0.008;
|
||||
|
@ -50,8 +50,6 @@ fn mesh_worker(
|
||||
}
|
||||
}
|
||||
|
||||
const MAX_WORKERS_QUEUED: usize = 32;
|
||||
|
||||
pub struct Terrain {
|
||||
chunks: HashMap<Vec2<i32>, TerrainChunk>,
|
||||
|
||||
@ -60,7 +58,6 @@ pub struct Terrain {
|
||||
mesh_send_tmp: mpsc::Sender<MeshWorkerResponse>,
|
||||
mesh_recv: mpsc::Receiver<MeshWorkerResponse>,
|
||||
mesh_todo: HashMap<Vec2<i32>, ChunkMeshState>,
|
||||
workers_queued: usize,
|
||||
}
|
||||
|
||||
impl Terrain {
|
||||
@ -75,7 +72,6 @@ impl Terrain {
|
||||
mesh_send_tmp: send,
|
||||
mesh_recv: recv,
|
||||
mesh_todo: HashMap::new(),
|
||||
workers_queued: 0,
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,10 +149,6 @@ impl Terrain {
|
||||
// Only spawn workers for meshing jobs without an active worker already.
|
||||
.filter(|todo| !todo.active_worker)
|
||||
{
|
||||
if self.workers_queued >= MAX_WORKERS_QUEUED {
|
||||
break;
|
||||
}
|
||||
|
||||
// Find the area of the terrain we want. Because meshing needs to compute things like
|
||||
// ambient occlusion and edge elision, we also need the borders of the chunk's
|
||||
// neighbours too (hence the `- 1` and `+ 1`).
|
||||
@ -207,7 +199,6 @@ impl Terrain {
|
||||
));
|
||||
});
|
||||
todo.active_worker = true;
|
||||
self.workers_queued += 1;
|
||||
}
|
||||
|
||||
// Receive a chunk mesh from a worker thread and upload it to the GPU, then store it.
|
||||
@ -245,8 +236,6 @@ impl Terrain {
|
||||
// since it's either out of date or no longer needed.
|
||||
_ => {}
|
||||
}
|
||||
|
||||
self.workers_queued -= 1;
|
||||
}
|
||||
|
||||
// Construct view frustum
|
||||
|
@ -165,7 +165,6 @@ impl<'a> Sampler for ColumnGen<'a> {
|
||||
|
||||
// Cities
|
||||
// TODO: In a later MR
|
||||
/*
|
||||
let building = match &sim_chunk.location {
|
||||
Some(loc) => {
|
||||
let loc = &sim.locations[loc.loc_idx];
|
||||
@ -184,7 +183,6 @@ impl<'a> Sampler for ColumnGen<'a> {
|
||||
};
|
||||
|
||||
let alt = alt + building;
|
||||
*/
|
||||
|
||||
// Caves
|
||||
let cave_at = |wposf: Vec2<f64>| {
|
||||
|
@ -120,9 +120,9 @@ impl WorldSim {
|
||||
pub fn seed_elements(&mut self) {
|
||||
let mut rng = self.rng.clone();
|
||||
|
||||
let cell_size = 32;
|
||||
let cell_size = 16;
|
||||
let grid_size = WORLD_SIZE / cell_size;
|
||||
let loc_count = 250;
|
||||
let loc_count = 100;
|
||||
|
||||
let mut loc_grid = vec![None; grid_size.product()];
|
||||
let mut locations = Vec::new();
|
||||
|
Loading…
Reference in New Issue
Block a user