mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Improved cave proportions
This commit is contained in:
parent
e618e97b1f
commit
07eb56f287
@ -201,14 +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(600.0).into_array()) as f32)
|
||||
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)
|
||||
.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
|
||||
+ (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(12.0).mul(96.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 {
|
||||
alt,
|
||||
@ -296,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(20.0).powf(4.0).neg().add(1.0) > 0.996;
|
||||
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;
|
||||
|
||||
if cave {
|
||||
None
|
||||
|
Loading…
Reference in New Issue
Block a user