From a98d4adc27f641496eda8a9ebf3c1c407ee1fa1f Mon Sep 17 00:00:00 2001 From: flyingfryingpan Date: Wed, 6 Nov 2019 03:19:50 -0800 Subject: [PATCH] forsharp --- assets/voxygen/background/bg_main.png | 4 +- world/src/block/mod.rs | 4 +- world/src/column/mod.rs | 54 ++++++++++++++------------- world/src/config.rs | 2 +- world/src/sim/mod.rs | 38 +++++++++++-------- 5 files changed, 57 insertions(+), 45 deletions(-) diff --git a/assets/voxygen/background/bg_main.png b/assets/voxygen/background/bg_main.png index 932d14be00..28aa4c2f41 100644 --- a/assets/voxygen/background/bg_main.png +++ b/assets/voxygen/background/bg_main.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:abdedad035b9e4cd495af42e343068b783f2b09a8d7635cff895be2243cf1cc2 -size 538326 +oid sha256:fafc5f99d29ac1bad5a0c2a30c063ac779eaa2a336f7be38900b05f4e281f052 +size 397501 diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index bf66d39189..cbbb9749df 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -168,6 +168,7 @@ impl<'a> BlockGen<'a> { temp, humidity, chunk, + stone_col, .. } = sample; @@ -233,7 +234,7 @@ impl<'a> BlockGen<'a> { // Sample blocks // let stone_col = Rgb::new(240, 230, 220); - let stone_col = Rgb::new(195, 187, 201); + //let stone_col = Rgb::new(195, 187, 201); // let dirt_col = Rgb::new(79, 67, 60); @@ -252,6 +253,7 @@ impl<'a> BlockGen<'a> { saturate_srgb(sub_surface_color, 0.45).map(|e| (e * 255.0) as u8), stone_col, (height - grass_depth - wposf.z as f32) * 0.15, + ); // Underground diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 1f4e68aaf6..734b31b504 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -825,23 +825,24 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { .mul(0.5) .add(marble_small.sub(0.5).mul(0.25)); - let temp = temp.add((marble - 0.5) * 0.25); - let humidity = humidity.add((marble - 0.5) * 0.25); + //let temp = temp.add((marble - 0.5) * 0.1); + //let humidity = humidity.add((marble - 0.5) * 0.10); // Colours - let cold_grass = Rgb::new(0.0, 0.5, 0.25); - let warm_grass = Rgb::new(0.4, 0.8, 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 cold_stone = Rgb::new(0.57, 0.67, 0.8); - let warm_stone = Rgb::new(0.77, 0.77, 0.64); + let cold_grass = Rgb::new(0.1, 0.5, 0.1); + let warm_grass = Rgb::new(0.1, 0.6, 0.0); + let dark_grass = Rgb::new(0.1, 0.3, 0.2); + let wet_grass = Rgb::new(0.1, 0.5, 0.5); + let cold_stone = Rgb::new(0.5, 0.5, 0.5); + //let warm_stone = Rgb::new(0.6, 0.6, 0.5); + let warm_stone = Rgb::new(0.7, 0.8, 0.7); let beach_sand = Rgb::new(0.9, 0.82, 0.6); - let desert_sand = Rgb::new(0.95, 0.75, 0.5); - let snow = Rgb::new(0.8, 0.85, 1.0); - - let dirt = Lerp::lerp( - Rgb::new(0.075, 0.07, 0.3), - Rgb::new(0.75, 0.55, 0.1), + let desert_sand = Rgb::new(0.7, 0.7, 0.4); + let snow = Rgb::new(0.0, 0.0, 0.1); + let stone_col = Rgb::new(205, 186, 50); + let dirt = Lerp::lerp( + Rgb::new(0.6, 0.5, 0.0), + Rgb::new(0.6, 0.5, 0.1), marble, ); let tundra = Lerp::lerp(snow, Rgb::new(0.01, 0.3, 0.0), 0.4 + marble * 0.6); @@ -880,7 +881,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { sand, temp.sub(CONFIG.snow_temp) .div(CONFIG.desert_temp.sub(CONFIG.snow_temp)) - .mul(0.5), + .mul(4.5), ), cliff, alt.sub(CONFIG.mountain_scale * 0.25) @@ -901,7 +902,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { .div(CONFIG.snow_temp.neg()) /*.sub((marble - 0.5) * 0.05) .mul(256.0)*/ - .mul(1.0), + .mul(8.0), ), // 0 to tropical_temp grass, @@ -911,18 +912,18 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { moss, temp.sub(CONFIG.tropical_temp) .div(CONFIG.desert_temp.sub(CONFIG.tropical_temp)) - .mul(1.0), + .mul(8.0), ), // above desert_temp sand, temp.sub(CONFIG.desert_temp) .div(1.0 - CONFIG.desert_temp) - .mul(4.0), + .mul(8.0), ), humidity .sub(CONFIG.desert_hum) .div(CONFIG.forest_hum.sub(CONFIG.desert_hum)) - .mul(1.0), + .mul(8.0), ); // From forest to jungle humidity, we go from snow to dark grass to grass to tropics to sand // depending on temperature. @@ -940,18 +941,18 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { tropical, temp.sub(CONFIG.tropical_temp) .div(CONFIG.desert_temp.sub(CONFIG.tropical_temp)) - .mul(1.0), + .mul(8.0), ), // above desert_temp sand, temp.sub(CONFIG.desert_temp) .div(1.0 - CONFIG.desert_temp) - .mul(4.0), + .mul(8.0), ), humidity .sub(CONFIG.forest_hum) .div(CONFIG.jungle_hum.sub(CONFIG.forest_hum)) - .mul(1.0), + .mul(8.0), ); // From jungle humidity upwards, we go from snow to grass to rainforest to tropics to sand. let ground = Rgb::lerp( @@ -968,13 +969,13 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { tropical, temp.sub(CONFIG.tropical_temp) .div(CONFIG.desert_temp.sub(CONFIG.tropical_temp)) - .mul(4.0), + .mul(8.0), ), // above desert_temp sand, temp.sub(CONFIG.desert_temp) .div(1.0 - CONFIG.desert_temp) - .mul(4.0), + .mul(8.0), ), humidity.sub(CONFIG.jungle_hum).mul(1.0), ); @@ -1045,7 +1046,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { // Beach ((ocean_level - 1.0) / 2.0).max(0.0), ), - sub_surface_color: dirt, + sub_surface_color: warm_grass, tree_density, forest_kind: sim_chunk.forest_kind, close_structures: self.gen_close_structures(wpos), @@ -1062,6 +1063,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { humidity, spawn_rate, location: sim_chunk.location.as_ref(), + stone_col, chunk: sim_chunk, spawn_rules: sim_chunk @@ -1102,6 +1104,8 @@ pub struct ColumnSample<'a> { pub humidity: f32, pub spawn_rate: f32, pub location: Option<&'a LocationInfo>, + //making cliffs + pub stone_col: Rgb, pub chunk: &'a SimChunk, pub spawn_rules: SpawnRules, diff --git a/world/src/config.rs b/world/src/config.rs index 1e5a372409..3a6bf149e4 100644 --- a/world/src/config.rs +++ b/world/src/config.rs @@ -48,7 +48,7 @@ pub const CONFIG: Config = Config { mountain_scale: 2048.0, snow_temp: -0.6, tropical_temp: 0.2, - desert_temp: 0.6, + desert_temp: 0.9, desert_hum: 0.15, forest_hum: 0.5, jungle_hum: 0.85, diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index bc58f926a7..0006b7bdb5 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -67,13 +67,13 @@ struct GenCdf { rivers: Box<[RiverData]>, } -pub(crate) struct GenCtx { + pub(crate) struct GenCtx { pub turb_x_nz: SuperSimplex, pub turb_y_nz: SuperSimplex, pub chaos_nz: RidgedMulti, pub alt_nz: HybridMulti, pub hill_nz: SuperSimplex, - pub temp_nz: SuperSimplex, + pub temp_nz: Fbm, // Humidity noise pub humid_nz: Billow, // Small amounts of noise for simulating rough terrain. @@ -112,20 +112,26 @@ impl WorldSim { let gen_ctx = GenCtx { turb_x_nz: SuperSimplex::new().set_seed(rng.gen()), turb_y_nz: SuperSimplex::new().set_seed(rng.gen()), - chaos_nz: RidgedMulti::new().set_octaves(7).set_seed(rng.gen()), + chaos_nz: RidgedMulti::new().set_octaves(2).set_seed(rng.gen()), hill_nz: SuperSimplex::new().set_seed(rng.gen()), alt_nz: HybridMulti::new() - .set_octaves(8) + .set_octaves(2) .set_persistence(0.1) .set_seed(rng.gen()), - temp_nz: SuperSimplex::new().set_seed(rng.gen()), - small_nz: BasicMulti::new().set_octaves(2).set_seed(rng.gen()), + //temp_nz: SuperSimplex::new().set_seed(rng.gen()), + + temp_nz: Fbm::new() + .set_octaves(8) + .set_persistence(0.9) + .set_seed(rng.gen()), + + small_nz: BasicMulti::new().set_octaves(1).set_seed(rng.gen()), rock_nz: HybridMulti::new().set_persistence(0.3).set_seed(rng.gen()), - cliff_nz: HybridMulti::new().set_persistence(0.3).set_seed(rng.gen()), - warp_nz: FastNoise::new(rng.gen()), //BasicMulti::new().set_octaves(3).set_seed(gen_seed()), + cliff_nz: HybridMulti::new().set_persistence(0.1).set_seed(rng.gen()), + warp_nz: FastNoise::new(rng.gen()), //BasicMulti::new().set_octaves(1).set_seed(gen_seed()), tree_nz: BasicMulti::new() - .set_octaves(12) - .set_persistence(0.75) + .set_octaves(1) + .set_persistence(0.1) .set_seed(rng.gen()), cave_0_nz: SuperSimplex::new().set_seed(rng.gen()), cave_1_nz: SuperSimplex::new().set_seed(rng.gen()), @@ -134,9 +140,9 @@ impl WorldSim { region_gen: StructureGen2d::new(rng.gen(), 400, 96), cliff_gen: StructureGen2d::new(rng.gen(), 80, 56), humid_nz: Billow::new() - .set_octaves(12) - .set_persistence(0.125) - .set_frequency(1.0) + .set_octaves(9) + .set_persistence(0.7) + .set_frequency(0.2) // .set_octaves(6) // .set_persistence(0.5) .set_seed(rng.gen()), @@ -186,7 +192,7 @@ impl WorldSim { .get((wposf.div(400.0)).into_array()) .min(1.0) .max(-1.0) - .mul(0.3)) + .mul(0.9)) .add(0.3) .max(0.0); @@ -1024,7 +1030,7 @@ impl SimChunk { // Take the weighted average of our randomly generated base humidity, the scaled // negative altitude, and the calculated water flux over this point in order to compute // humidity. - const HUMID_WEIGHTS: [f32; 3] = [4.0, 1.0, 1.0]; + const HUMID_WEIGHTS: [f32; 3] = [4.0, 0.1, 0.1]; let humidity = cdf_irwin_hall( &HUMID_WEIGHTS, [humid_uniform, flux_uniform, 1.0 - alt_uniform], @@ -1032,7 +1038,7 @@ impl SimChunk { // We also correlate temperature negatively with altitude and absolute latitude, using // different weighting than we use for humidity. - const TEMP_WEIGHTS: [f32; 2] = [2.0, 1.0 /*, 1.0*/]; + const TEMP_WEIGHTS: [f32; 2] = [2.0, 16.0 /*, 1.0*/]; let temp = cdf_irwin_hall( &TEMP_WEIGHTS, [