mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Made caves wider
This commit is contained in:
parent
e2182b1a68
commit
b554d7b19e
@ -201,13 +201,14 @@ impl<'a> Sampler<'a> {
|
||||
);
|
||||
|
||||
// Caves
|
||||
let cave_xy = (sim.gen_ctx.cave_0_nz.get(Vec3::new(wposf.x, wposf.y, alt as f64 * 8.0).div(800.0).into_array()) as f32)
|
||||
let cave_at = |wposf: Vec2<f64>| (sim.gen_ctx.cave_0_nz.get(Vec3::new(wposf.x, wposf.y, alt as f64 * 8.0).div(800.0).into_array()) as f32)
|
||||
.powf(2.0)
|
||||
.neg()
|
||||
.add(1.0)
|
||||
.mul((1.15 - chaos).min(1.0));
|
||||
let cave_alt = alt - 24.0
|
||||
+ (sim.gen_ctx.cave_1_nz.get(Vec2::new(wposf.x, wposf.y).div(32.0).into_array()) as f32) * 6.0
|
||||
let cave_xy = cave_at(wposf).min(cave_at(-wposf));
|
||||
let cave_alt = alt - 32.0
|
||||
+ (sim.gen_ctx.cave_1_nz.get(Vec2::new(wposf.x, wposf.y).div(48.0).into_array()) as f32) * 8.0
|
||||
+ (sim.gen_ctx.cave_1_nz.get(Vec2::new(wposf.x, wposf.y).div(300.0).into_array()) as f32).add(1.0).mul(0.5).powf(8.0).mul(256.0);
|
||||
|
||||
Some(Sample2d {
|
||||
@ -268,7 +269,7 @@ impl<'a> Sampler<'a> {
|
||||
.get((wposf.div(Vec3::new(120.0, 120.0, 150.0))).into_array())
|
||||
as f32)
|
||||
.mul((chaos - 0.1).max(0.0))
|
||||
.mul(90.0);
|
||||
.mul(110.0);
|
||||
|
||||
let height = alt + warp;
|
||||
let temp = 0.0;
|
||||
@ -295,7 +296,7 @@ impl<'a> Sampler<'a> {
|
||||
};
|
||||
|
||||
let ground_block = if let Some(block) = ground_block { // Underground
|
||||
let cave = cave_xy.powf(2.0) * (wposf.z as f32 - cave_alt).div(40.0).powf(4.0).neg().add(1.0) > 0.9996;
|
||||
let cave = cave_xy.powf(2.0) * (wposf.z as f32 - cave_alt).div(40.0).powf(4.0).neg().add(1.0) > 0.9993;
|
||||
|
||||
if cave {
|
||||
None
|
||||
|
Loading…
Reference in New Issue
Block a user