-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more vanilla density function examples and fixed a bug
- Loading branch information
Showing
26 changed files
with
544 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,75 @@ | ||
include "minecraft.densityfunction"; | ||
import df.*; | ||
|
||
// Density functions | ||
function shift_x = flat_cache(cache_2d(shift_a("minecraft:offset"))); | ||
function shift_z = flat_cache(cache_2d(shift_b("minecraft:offset"))); | ||
function y = y_clamped_gradient(-4064, 4062, -4064.0, 4062.0); | ||
function zero = 0.0; | ||
|
||
function 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"; | ||
module overworld { | ||
function base_3d_noise = old_blended_noise(0.25, 0.125, 80.0, 160.0, 8.0); | ||
|
||
function continents = flat_cache(shifted_noise("minecraft:shift_x", 0.0, "minecraft:shift_z", 0.25, 0.0, "minecraft:continentalness")); | ||
function depth = y_clamped_gradient(-64, 320, 1.5, -1.5) + "minecraft:overworld/offset"; | ||
function erosion = flat_cache(shifted_noise("minecraft:shift_x", 0.0, "minecraft:shift_z", 0.25, 0.0, "minecraft:erosion")); | ||
|
||
// function offset = flat_cache(cache_2d(...)); | ||
// function factor = flat_cache(cache_2d(...)); | ||
// function jaggedness = flat_cache(cache_2d(...)); | ||
|
||
function ridges = flat_cache(shifted_noise("minecraft:shift_x", 0.0, "minecraft:shift_z", 0.25, 0.0, "minecraft:ridge")); | ||
function ridges_folded = -3.0 * (-0.3333333333333333 + abs(-0.6666666666666666 + abs("minecraft:overworld/ridges"))); | ||
|
||
function 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"; | ||
|
||
module caves { | ||
function 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) | ||
)); | ||
|
||
function 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))) | ||
) | ||
); | ||
|
||
function 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)) | ||
); | ||
|
||
function spaghetti_2d_thickness_modulator = cache_once( | ||
-0.95 + -0.35000000000000003 * noise("minecraft:spaghetti_2d_thickness", 2.0, 1.0) | ||
); | ||
|
||
function 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 | ||
); | ||
|
||
function 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))) | ||
); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "minecraft:old_blended_noise", | ||
"xz_scale": 0.25, | ||
"y_scale": 0.125, | ||
"xz_factor": 80.0, | ||
"y_factor": 160.0, | ||
"smear_scale_multiplier": 8.0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"type": "minecraft:cache_once", | ||
"argument": { | ||
"type": "minecraft:min", | ||
"argument1": { | ||
"type": "minecraft:add", | ||
"argument1": { | ||
"type": "minecraft:add", | ||
"argument1": 0.37, | ||
"argument2": { | ||
"type": "minecraft:noise", | ||
"noise": "minecraft:cave_entrance", | ||
"xz_scale": 0.75, | ||
"y_scale": 0.5 | ||
} | ||
}, | ||
"argument2": { | ||
"type": "minecraft:y_clamped_gradient", | ||
"from_y": -10, | ||
"to_y": -30, | ||
"from_value": 0.3, | ||
"to_value": 0.0 | ||
} | ||
}, | ||
"argument2": { | ||
"type": "minecraft:add", | ||
"argument1": "minecraft:overworld/caves/spaghetti_roughness_function", | ||
"argument2": { | ||
"type": "minecraft:clamp", | ||
"input": { | ||
"type": "minecraft:add", | ||
"argument1": { | ||
"type": "minecraft:max", | ||
"argument1": { | ||
"type": "minecraft:weird_scaled_sampler", | ||
"noise": "minecraft:spaghetti_3d_1", | ||
"rarity_value_mapper": "type_1" | ||
}, | ||
"argument2": { | ||
"type": "minecraft:weird_scaled_sampler", | ||
"noise": "minecraft:spaghetti_3d_2", | ||
"rarity_value_mapper": "type_1" | ||
} | ||
}, | ||
"argument2": { | ||
"type": "minecraft:add", | ||
"argument1": -0.0765, | ||
"argument2": { | ||
"type": "minecraft:mul", | ||
"argument1": -0.011499999999999996, | ||
"argument2": { | ||
"type": "minecraft:noise", | ||
"noise": "minecraft:spaghetti_3d_thickness", | ||
"xz_scale": 1.0, | ||
"y_scale": 1.0 | ||
} | ||
} | ||
} | ||
}, | ||
"min": -1.0, | ||
"max": 1.0 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"type": "minecraft:range_choice", | ||
"input": { | ||
"type": "minecraft:interpolated", | ||
"argument": { | ||
"type": "minecraft:range_choice", | ||
"input": "minecraft:y", | ||
"min_inclusive": -60.0, | ||
"max_inclusive": 321.0, | ||
"when_in_range": { | ||
"type": "minecraft:noise", | ||
"noise": "minecraft:noodle", | ||
"xz_scale": 1.0, | ||
"y_scale": 1.0 | ||
}, | ||
"when_out_of_range": -1.0 | ||
} | ||
}, | ||
"min_inclusive": -1000000.0, | ||
"max_inclusive": 0.0, | ||
"when_in_range": 64.0, | ||
"when_out_of_range": { | ||
"type": "minecraft:add", | ||
"argument1": { | ||
"type": "minecraft:interpolated", | ||
"argument": { | ||
"type": "minecraft:range_choice", | ||
"input": "minecraft:y", | ||
"min_inclusive": -60.0, | ||
"max_inclusive": 321.0, | ||
"when_in_range": { | ||
"type": "minecraft:add", | ||
"argument1": -0.07500000000000001, | ||
"argument2": { | ||
"type": "minecraft:mul", | ||
"argument1": -0.025, | ||
"argument2": { | ||
"type": "minecraft:noise", | ||
"noise": "minecraft:noodle_thickness", | ||
"xz_scale": 1.0, | ||
"y_scale": 1.0 | ||
} | ||
} | ||
}, | ||
"when_out_of_range": 0.0 | ||
} | ||
}, | ||
"argument2": { | ||
"type": "minecraft:mul", | ||
"argument1": 1.5, | ||
"argument2": { | ||
"type": "minecraft:max", | ||
"argument1": { | ||
"type": "minecraft:abs", | ||
"argument": { | ||
"type": "minecraft:interpolated", | ||
"argument": { | ||
"type": "minecraft:range_choice", | ||
"input": "minecraft:y", | ||
"min_inclusive": -60.0, | ||
"max_inclusive": 321.0, | ||
"when_in_range": { | ||
"type": "minecraft:noise", | ||
"noise": "minecraft:noodle_ridge_a", | ||
"xz_scale": 1.0, | ||
"y_scale": 1.0 | ||
}, | ||
"when_out_of_range": 0.0 | ||
} | ||
} | ||
}, | ||
"argument2": { | ||
"type": "minecraft:abs", | ||
"argument": { | ||
"type": "minecraft:interpolated", | ||
"argument": { | ||
"type": "minecraft:range_choice", | ||
"input": "minecraft:y", | ||
"min_inclusive": -60.0, | ||
"max_inclusive": 321.0, | ||
"when_in_range": { | ||
"type": "minecraft:noise", | ||
"noise": "minecraft:noodle_ridge_b", | ||
"xz_scale": 1.0, | ||
"y_scale": 1.0 | ||
}, | ||
"when_out_of_range": 0.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.