mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Attempted rivers
This commit is contained in:
@ -35,6 +35,7 @@ impl<'a> Sampler for ColumnGen<'a> {
|
|||||||
let alt_base = sim.get_interpolated(wpos, |chunk| chunk.alt_base)?;
|
let alt_base = sim.get_interpolated(wpos, |chunk| chunk.alt_base)?;
|
||||||
let chaos = sim.get_interpolated(wpos, |chunk| chunk.chaos)?;
|
let chaos = sim.get_interpolated(wpos, |chunk| chunk.chaos)?;
|
||||||
let temp = sim.get_interpolated(wpos, |chunk| chunk.temp)?;
|
let temp = sim.get_interpolated(wpos, |chunk| chunk.temp)?;
|
||||||
|
let dryness = sim.get_interpolated(wpos, |chunk| chunk.dryness)?;
|
||||||
let rockiness = sim.get_interpolated(wpos, |chunk| chunk.rockiness)?;
|
let rockiness = sim.get_interpolated(wpos, |chunk| chunk.rockiness)?;
|
||||||
let cliffiness = sim.get_interpolated(wpos, |chunk| chunk.cliffiness)?;
|
let cliffiness = sim.get_interpolated(wpos, |chunk| chunk.cliffiness)?;
|
||||||
let tree_density = sim.get_interpolated(wpos, |chunk| chunk.tree_density)?;
|
let tree_density = sim.get_interpolated(wpos, |chunk| chunk.tree_density)?;
|
||||||
@ -45,7 +46,8 @@ impl<'a> Sampler for ColumnGen<'a> {
|
|||||||
+ (sim.gen_ctx.small_nz.get((wposf.div(256.0)).into_array()) as f32)
|
+ (sim.gen_ctx.small_nz.get((wposf.div(256.0)).into_array()) as f32)
|
||||||
.abs()
|
.abs()
|
||||||
.mul(chaos.max(0.2))
|
.mul(chaos.max(0.2))
|
||||||
.mul(64.0);
|
.mul(64.0)
|
||||||
|
- dryness.abs().neg().add(0.03).max(0.0).mul(3000.0);
|
||||||
|
|
||||||
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)
|
||||||
|
@ -232,6 +232,7 @@ pub struct SimChunk {
|
|||||||
pub alt_base: f32,
|
pub alt_base: f32,
|
||||||
pub alt: f32,
|
pub alt: f32,
|
||||||
pub temp: f32,
|
pub temp: f32,
|
||||||
|
pub dryness: f32,
|
||||||
pub rockiness: f32,
|
pub rockiness: f32,
|
||||||
pub cliffiness: f32,
|
pub cliffiness: f32,
|
||||||
pub tree_density: f32,
|
pub tree_density: f32,
|
||||||
@ -255,15 +256,15 @@ impl SimChunk {
|
|||||||
.add(0.3)
|
.add(0.3)
|
||||||
.max(0.0);
|
.max(0.0);
|
||||||
|
|
||||||
|
let dryness = (gen_ctx.chaos_nz.get((wposf.div(1_000.0)).into_array()) as f32);
|
||||||
|
|
||||||
let chaos = (gen_ctx.chaos_nz.get((wposf.div(4_000.0)).into_array()) as f32)
|
let chaos = (gen_ctx.chaos_nz.get((wposf.div(4_000.0)).into_array()) as f32)
|
||||||
.add(1.0)
|
.add(1.0)
|
||||||
.mul(0.5)
|
.mul(0.5)
|
||||||
.mul(
|
.mul((gen_ctx.chaos_nz.get((wposf.div(8_000.0)).into_array()) as f32)
|
||||||
(gen_ctx.chaos_nz.get((wposf.div(8_000.0)).into_array()) as f32)
|
.powf(2.0)
|
||||||
.powf(2.0)
|
.add(0.5)
|
||||||
.add(0.5)
|
.min(1.0))
|
||||||
.min(1.0),
|
|
||||||
)
|
|
||||||
.powf(1.4)
|
.powf(1.4)
|
||||||
.add(0.1 * hill);
|
.add(0.1 * hill);
|
||||||
|
|
||||||
@ -299,6 +300,7 @@ impl SimChunk {
|
|||||||
alt_base,
|
alt_base,
|
||||||
alt,
|
alt,
|
||||||
temp,
|
temp,
|
||||||
|
dryness,
|
||||||
rockiness: (gen_ctx.rock_nz.get((wposf.div(1024.0)).into_array()) as f32)
|
rockiness: (gen_ctx.rock_nz.get((wposf.div(1024.0)).into_array()) as f32)
|
||||||
.sub(0.1)
|
.sub(0.1)
|
||||||
.mul(1.3)
|
.mul(1.3)
|
||||||
|
Reference in New Issue
Block a user