Re-added oceans

This commit is contained in:
Joshua Barretto 2019-07-08 20:08:08 +01:00
parent 6b415c1b87
commit 8e8bad137a
3 changed files with 17 additions and 17 deletions

View File

@ -164,7 +164,7 @@ impl<'a> BlockGen<'a> {
.get((wposf.div(Vec3::new(150.0, 150.0, 150.0))).into_array()) .get((wposf.div(Vec3::new(150.0, 150.0, 150.0))).into_array())
as f32) as f32)
.mul((chaos - 0.1).max(0.0)) .mul((chaos - 0.1).max(0.0))
.mul(115.0); .mul(96.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
@ -195,7 +195,7 @@ impl<'a> BlockGen<'a> {
(alt + warp).max(cliff_height) (alt + warp).max(cliff_height)
}; };
(false, height, water_level + warp) (false, height, (water_level + warp).max(CONFIG.sea_level))
}; };
// Sample blocks // Sample blocks
@ -395,8 +395,9 @@ impl<'a> ZCache<'a> {
}, },
) as f32; ) as f32;
let max = let max = (self.sample.alt + cliff + structure + warp + 8.0)
(self.sample.alt + cliff + structure + warp + 8.0).max(self.sample.water_level + 2.0); .max(self.sample.water_level)
.max(CONFIG.sea_level + 2.0);
(min, max) (min, max)
} }

View File

@ -75,7 +75,7 @@ impl<'a> Sampler for ColumnGen<'a> {
.mul(0.5) .mul(0.5)
.mul(24.0); .mul(24.0);
let water_level = (riverless_alt - 4.0 - 5.0 * chaos).max(CONFIG.sea_level); let water_level = riverless_alt - 4.0 - 5.0 * chaos;
let rock = (sim.gen_ctx.small_nz.get( let rock = (sim.gen_ctx.small_nz.get(
Vec3::new(wposf.x, wposf.y, alt as f64) Vec3::new(wposf.x, wposf.y, alt as f64)
@ -103,8 +103,8 @@ impl<'a> Sampler for ColumnGen<'a> {
let warm_grass = Rgb::new(0.18, 0.65, 0.0); let warm_grass = Rgb::new(0.18, 0.65, 0.0);
let cold_stone = Rgb::new(0.55, 0.7, 0.75); let cold_stone = Rgb::new(0.55, 0.7, 0.75);
let warm_stone = Rgb::new(0.65, 0.65, 0.35); let warm_stone = Rgb::new(0.65, 0.65, 0.35);
let beach_sand = Rgb::new(0.93, 0.84, 0.4); let beach_sand = Rgb::new(0.9, 0.85, 0.3);
let desert_sand = Rgb::new(0.98, 0.8, 0.15); let desert_sand = Rgb::new(1.0, 0.7, 0.15);
let snow = Rgb::broadcast(1.0); let snow = Rgb::broadcast(1.0);
let dirt = Lerp::lerp(Rgb::new(0.2, 0.1, 0.05), Rgb::new(0.4, 0.25, 0.0), marble); let dirt = Lerp::lerp(Rgb::new(0.2, 0.1, 0.05), Rgb::new(0.4, 0.25, 0.0), marble);
@ -115,7 +115,7 @@ impl<'a> Sampler for ColumnGen<'a> {
let tropical = Rgb::lerp( let tropical = Rgb::lerp(
grass, grass,
Rgb::new(0.95, 0.85, 0.1), Rgb::new(1.0, 0.75, 0.1),
marble_small.sub(0.5).mul(0.05).add(0.3), marble_small.sub(0.5).mul(0.05).add(0.3),
); );
@ -232,16 +232,17 @@ impl<'a> Sampler for ColumnGen<'a> {
cliff, cliff,
snow, snow,
(alt - CONFIG.sea_level (alt - CONFIG.sea_level
- 0.35 * CONFIG.mountain_scale - 0.4 * CONFIG.mountain_scale
- alt_base - alt_base
- temp * 96.0 - temp * 96.0
- marble * 24.0) - marble * 24.0)
/ 12.0, / 12.0,
), ),
(alt - CONFIG.sea_level - 0.3 * CONFIG.mountain_scale + marble * 128.0) / 100.0, (alt - CONFIG.sea_level - 0.25 * CONFIG.mountain_scale + marble * 128.0)
/ 100.0,
), ),
// Beach // Beach
((alt - CONFIG.sea_level - 2.0) / 5.0).min(1.0 - river * 2.0), ((alt - CONFIG.sea_level - 1.0) / 2.0).min(1.0 - river * 2.0),
), ),
sub_surface_color: dirt, sub_surface_color: dirt,
tree_density, tree_density,

View File

@ -351,7 +351,7 @@ impl SimChunk {
.add(0.3) .add(0.3)
.max(0.0); .max(0.0);
let temp = gen_ctx.temp_nz.get((wposf.div(15000.0)).into_array()) as f32; let temp = gen_ctx.temp_nz.get((wposf.div(12000.0)).into_array()) as f32;
let dryness = gen_ctx.dry_nz.get( let dryness = gen_ctx.dry_nz.get(
(wposf (wposf
@ -385,11 +385,9 @@ impl SimChunk {
) )
.max(0.15); .max(0.15);
let alt_base = gen_ctx.alt_nz.get((wposf.div(6_000.0)).into_array()) as f32; let alt_base = (gen_ctx.alt_nz.get((wposf.div(12_000.0)).into_array()) as f32)
let alt_base = alt_base .mul(250.0)
.mul(0.4) .sub(25.0);
.add(alt_base.mul(128.0).sin().mul(0.005))
.mul(400.0);
let alt_main = (gen_ctx.alt_nz.get((wposf.div(2_000.0)).into_array()) as f32) let alt_main = (gen_ctx.alt_nz.get((wposf.div(2_000.0)).into_array()) as f32)
.abs() .abs()