-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.densityfunction
98 lines (82 loc) · 5.05 KB
/
main.densityfunction
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
include "minecraft.densityfunction";
import df.*;
export shift_x = flat_cache(cache_2d(shift_a("minecraft:offset")));
export shift_z = flat_cache(cache_2d(shift_b("minecraft:offset")));
export y = y_clamped_gradient(-4064, 4062, -4064.0, 4062.0);
export zero = 0.0;
module overworld {
export base_3d_noise = old_blended_noise(0.25, 0.125, 80.0, 160.0, 8.0);
export continents = flat_cache(shifted_noise("minecraft:continentalness", "minecraft:shift_x", 0.0, "minecraft:shift_z", 0.25, 0.0));
export depth = y_clamped_gradient(-64, 320, 1.5, -1.5) + "minecraft:overworld/offset";
export erosion = flat_cache(shifted_noise("minecraft:erosion", "minecraft:shift_x", 0.0, "minecraft:shift_z", 0.25, 0.0));
include "offset_factor_jaggedness.densityfunction";
export ridges = flat_cache(shifted_noise("minecraft:shift_x", 0.0, "minecraft:shift_z", 0.25, 0.0, "minecraft:ridge"));
export ridges_folded = -3.0 * (-0.3333333333333333 + (-0.6666666666666666 + "minecraft:overworld/ridges".abs()).abs());
export sloped_cheese = 4.0 * quarter_negative(
("minecraft:overworld/depth" + "minecraft:overworld/jaggedness" * half_negative(noise("minecraft:jagged", 1500.0, 0.0)))
* "minecraft:overworld/factor") + "minecraft:overworld/base_3d_noise";
template caves_function() {
max(
min(min(
4.0 * noise("minecraft:cave_layer", 1.0, 8.0) + clamp(0.27 + noise("minecraft:cave_cheese", 1.0, 0.6666666666666666), -1.0, 1.0)
+ clamp(1.5 + -0.64 * "minecraft:overworld/sloped_cheese", 0.0, 0.5),
"minecraft:overworld/caves/entrances"
), "minecraft:overworld/caves/spaghetti_2d" + "minecraft:overworld/caves/spaghetti_roughness_function"),
range_choice("minecraft:overworld/caves/pillars", -1000000.0, 0.03, -1000000.0, "minecraft:overworld/caves/pillars")
)
}
template initial_density(factor, depth) {
4.0 * (depth * factor).quarter_negative()
}
export initial_density_without_jaggedness = apply_surface_slides(
clamp(-0.703125 + initial_density(cache_2d("minecraft:overworld/factor"), "minecraft:overworld/depth"), -64.0, 64.0)
);
export final_density = min(apply_blend_density(apply_surface_slides(
range_choice("minecraft:overworld/sloped_cheese", -1000000.0, 1.5625, min(
"minecraft:overworld/sloped_cheese", 5.0 * "minecraft:overworld/caves/entrances"
), caves_function())
)), "minecraft:overworld/caves/noodle");
module caves {
export entrances = cache_once(min(
(0.37 + noise("minecraft:cave_entrance", 0.75, 0.5)) + y_clamped_gradient(-10, -30, 0.3, 0.0),
"minecraft:overworld/caves/spaghetti_roughness_function" +
clamp(
max(
weird_scaled_sampler(cache_once(noise("minecraft:spaghetti_3d_rarity", 2.0, 1.0)), "minecraft:spaghetti_3d_1", "type_1"),
weird_scaled_sampler(cache_once(noise("minecraft:spaghetti_3d_rarity", 2.0, 1.0)), "minecraft:spaghetti_3d_2", "type_1")
) + (
-0.0765 + -0.011499999999999996 * noise("minecraft:spaghetti_3d_thickness", 1.0, 1.0)
), -1.0, 1.0)
));
export noodle = range_choice(
interpolated(range_choice("minecraft:y", -60.0, 321.0, noise("minecraft:noodle", 1.0, 1.0), -1.0)),
-1000000.0, 0.0,
64.0,
interpolated(range_choice("minecraft:y", -60.0, 321.0, -0.07500000000000001 + -0.025 * noise("minecraft:noodle_thickness", 1.0, 1.0), 0.0))
+ 1.5 * max(
abs(interpolated(range_choice("minecraft:y", -60.0, 321.0, noise("minecraft:noodle_ridge_a", 1.0, 1.0), 0.0))),
abs(interpolated(range_choice("minecraft:y", -60.0, 321.0, noise("minecraft:noodle_ridge_b", 1.0, 1.0), 0.0)))
)
);
export pillars = cache_once(
(2.0 * noise("minecraft:pillar", 25.0, 0.3) + (-1.0 + -1.0 * noise("minecraft:pillar_rareness", 1.0, 1.0)))
* cube(0.55 + 0.55 * noise("minecraft:pillar_thickness", 1.0, 1.0))
);
export spaghetti_2d_thickness_modulator = cache_once(
-0.95 + -0.35000000000000003 * noise("minecraft:spaghetti_2d_thickness", 2.0, 1.0)
);
export spaghetti_2d = clamp(
max(
weird_scaled_sampler(noise("minecraft:spaghetti_2d_modulator", 2.0, 1.0), "minecraft:spaghetti_2d", "type_2")
+ 0.083 * "minecraft:overworld/caves/spaghetti_2d_thickness_modulator",
cube(abs(0.0 + 8.0 * noise("minecraft:spaghetti_2d_elevation", 1.0, 0.0) +
y_clamped_gradient(-64, 320, 8.0, -40.0)) + "minecraft:overworld/caves/spaghetti_2d_thickness_modulator")
),
-1.0, 1.0
);
export spaghetti_roughness_function = cache_once(
(-0.05 + -0.05 * noise("minecraft:spaghetti_roughness_modulator", 1.0, 1.0)) *
(-0.4 + abs(noise("minecraft:spaghetti_roughness", 1.0, 1.0)))
);
}
}