Worldgen colour tweaks, better buildings, better warping

This commit is contained in:
Joshua Barretto 2019-09-20 19:01:21 +01:00
parent 6717e5551b
commit 1e9eb3089e
8 changed files with 37 additions and 20 deletions

Binary file not shown.

Binary file not shown.

BIN
assets/world/module/human/window_corner_ground.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/world/module/human/window_corner_upstairs.vox (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

View File

@ -178,12 +178,13 @@ impl<'a> BlockGen<'a> {
(true, alt, CONFIG.sea_level /*water_level*/) (true, alt, CONFIG.sea_level /*water_level*/)
} else { } else {
// Apply warping // Apply warping
let warp = (world.sim().gen_ctx.warp_nz.get(wposf.div(48.0)) as f32) let warp = world
.mul((chaos - 0.1).max(0.0)) .sim()
.mul(48.0) .gen_ctx
+ (world.sim().gen_ctx.warp_nz.get(wposf.div(15.0)) as f32) .warp_nz
.mul((chaos - 0.1).max(0.0)) .get(wposf.div(24.0))
.mul(24.0); .mul((chaos - 0.1).max(0.0).powf(2.0))
.mul(48.0);
let height = if (wposf.z as f32) < alt + warp - 10.0 { let height = if (wposf.z as f32) < alt + warp - 10.0 {
// Shortcut cliffs // Shortcut cliffs

View File

@ -168,10 +168,10 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
+ (sim + (sim
.gen_ctx .gen_ctx
.small_nz .small_nz
.get((wposf_turb.div(150.0)).into_array()) as f32) .get((wposf_turb.div(200.0)).into_array()) as f32)
.abs() .abs()
.mul(chaos.max(0.025)) .mul(chaos.max(0.025))
.mul(64.0) .mul(50.0)
+ (sim + (sim
.gen_ctx .gen_ctx
.small_nz .small_nz
@ -179,7 +179,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
.abs() .abs()
.mul(1.0 - chaos) .mul(1.0 - chaos)
.mul(1.0 - humidity) .mul(1.0 - humidity)
.mul(96.0); .mul(75.0);
let is_cliffs = sim_chunk.is_cliffs; let is_cliffs = sim_chunk.is_cliffs;
let near_cliffs = sim_chunk.near_cliffs; let near_cliffs = sim_chunk.near_cliffs;
@ -225,13 +225,13 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
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);
let beach_sand = Rgb::new(0.89, 0.87, 0.64); let beach_sand = Rgb::new(0.9, 0.82, 0.6);
let desert_sand = Rgb::new(0.93, 0.80, 0.54); let desert_sand = Rgb::new(0.95, 0.75, 0.5);
let snow = Rgb::new(0.8, 0.85, 1.0); let snow = Rgb::new(0.8, 0.85, 1.0);
let dirt = Lerp::lerp( let dirt = Lerp::lerp(
Rgb::new(0.078, 0.078, 0.20), Rgb::new(0.085, 0.075, 0.25),
Rgb::new(0.61, 0.49, 0.0), Rgb::new(0.75, 0.45, 0.1),
marble, marble,
); );
let tundra = Lerp::lerp(snow, Rgb::new(0.01, 0.3, 0.0), 0.4 + marble * 0.6); let tundra = Lerp::lerp(snow, Rgb::new(0.01, 0.3, 0.0), 0.4 + marble * 0.6);

View File

@ -421,7 +421,7 @@ impl TownVol {
let mut cells: HashSet<_> = Some(entrance).into_iter().collect(); let mut cells: HashSet<_> = Some(entrance).into_iter().collect();
let mut energy = 1000; let mut energy = 3000;
while energy > 0 { while energy > 0 {
energy -= 1; energy -= 1;
@ -441,6 +441,8 @@ impl TownVol {
|| cells.contains(&(parent + dir - Vec3::unit_z())) || cells.contains(&(parent + dir - Vec3::unit_z()))
}) })
.unwrap_or(false) .unwrap_or(false)
&& parent.z + dir.z <= entrance.z + 3
// Maximum house height
{ {
cells.insert(parent + dir); cells.insert(parent + dir);
energy -= 10; energy -= 10;
@ -613,6 +615,10 @@ lazy_static! {
module("human.floor_ground", [This, This, This, This, This, That]), module("human.floor_ground", [This, This, This, This, This, That]),
module("human.stair_ground", [This, This, This, This, This, That]), module("human.stair_ground", [This, This, This, This, This, That]),
module("human.corner_ground", [This, This, That, That, This, That]), module("human.corner_ground", [This, This, That, That, This, That]),
module(
"human.window_corner_ground",
[This, This, That, That, This, That],
),
module("human.wall_ground", [This, This, This, That, This, That]), module("human.wall_ground", [This, This, This, That, This, That]),
module("human.door_ground", [This, This, This, That, This, That]), module("human.door_ground", [This, This, This, That, This, That]),
module("human.window_ground", [This, This, This, That, This, That]), module("human.window_ground", [This, This, This, That, This, That]),
@ -629,6 +635,10 @@ lazy_static! {
"human.corner_upstairs", "human.corner_upstairs",
[This, This, That, That, This, This], [This, This, That, That, This, This],
), ),
module(
"human.window_corner_upstairs",
[This, This, That, That, This, This],
),
module("human.wall_upstairs", [This, This, This, That, This, This]), module("human.wall_upstairs", [This, This, This, That, This, This]),
module( module(
"human.window_upstairs", "human.window_upstairs",