new worldgen wip

This commit is contained in:
minjaesong
2024-08-31 23:55:13 +09:00
parent 54d1218b4a
commit fa03e5d14a
2 changed files with 22 additions and 7 deletions

View File

@@ -250,6 +250,7 @@ interface TerragenParams {
val caveShapeFreq: Double //adjust the "density" of the caves val caveShapeFreq: Double //adjust the "density" of the caves
val caveAttenuateScale: Double // used with the caveAttenuateBias, controls the "concentration" of the cave gen val caveAttenuateScale: Double // used with the caveAttenuateBias, controls the "concentration" of the cave gen
val caveAttenuateBias: Double // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5)) val caveAttenuateBias: Double // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5))
val caveAttenuateBias1: Double // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5))
val caveSelectThre: Double // also adjust this if you've touched the bias value. Number can be greater than 1.0 val caveSelectThre: Double // also adjust this if you've touched the bias value. Number can be greater than 1.0
val caveBlockageFractalFreq: Double val caveBlockageFractalFreq: Double
val caveBlockageSelectThre: Double // adjust cave closing-up strength. Lower = more closing val caveBlockageSelectThre: Double // adjust cave closing-up strength. Lower = more closing
@@ -268,6 +269,7 @@ data class TerragenParamsAlpha1(
override val caveShapeFreq: Double = 4.0, //adjust the "density" of the caves override val caveShapeFreq: Double = 4.0, //adjust the "density" of the caves
override val caveAttenuateScale: Double = 1.0, // used with the caveAttenuateBias, controls the "concentration" of the cave gen override val caveAttenuateScale: Double = 1.0, // used with the caveAttenuateBias, controls the "concentration" of the cave gen
override val caveAttenuateBias: Double = 0.90, // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5)) override val caveAttenuateBias: Double = 0.90, // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5))
override val caveAttenuateBias1: Double = 0.5, // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5))
override val caveSelectThre: Double = 0.918, // also adjust this if you've touched the bias value. Number can be greater than 1.0 override val caveSelectThre: Double = 0.918, // also adjust this if you've touched the bias value. Number can be greater than 1.0
override val caveBlockageFractalFreq: Double = 8.88, override val caveBlockageFractalFreq: Double = 8.88,
override val caveBlockageSelectThre: Double = 1.40, // adjust cave closing-up strength. Lower = more closing override val caveBlockageSelectThre: Double = 1.40, // adjust cave closing-up strength. Lower = more closing
@@ -287,9 +289,10 @@ data class TerragenParamsAlpha2(
override val mountainDisturbance: Double = 0.7, // greater = more distortion, overhangs override val mountainDisturbance: Double = 0.7, // greater = more distortion, overhangs
override val caveShapeFreq: Double = 4.0, //adjust the "density" of the caves override val caveShapeFreq: Double = 4.0, //adjust the "density" of the caves
override val caveAttenuateScale: Double = 0.95, // used with the caveAttenuateBias, controls the "concentration" of the cave gen override val caveAttenuateScale: Double = 0.94, // used with the caveAttenuateBias, controls the "concentration" of the cave gen
override val caveAttenuateBias: Double = 0.93, // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5)) override val caveAttenuateBias: Double = 0.95, // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5))
override val caveSelectThre: Double = 0.918, // also adjust this if you've touched the bias value. Number can be greater than 1.0 override val caveAttenuateBias1: Double = 0.90, // 1.0: flattens the gradient (deep voids are less tend to be larger). Also controls the distribution of ores. Equation: x^(log(bias) / log(0.5))
override val caveSelectThre: Double = 0.915, // also adjust this if you've touched the bias value. Number can be greater than 1.0
override val caveBlockageFractalFreq: Double = 8.88, override val caveBlockageFractalFreq: Double = 8.88,
override val caveBlockageSelectThre: Double = 1.40, // adjust cave closing-up strength. Lower = more closing override val caveBlockageSelectThre: Double = 1.40, // adjust cave closing-up strength. Lower = more closing

View File

@@ -606,17 +606,29 @@ internal object TerragenTest : NoiseMaker {
it.setBias(params.caveAttenuateBias) // (0.5+) adjust the "concentration" of the cave gen. Lower = larger voids it.setBias(params.caveAttenuateBias) // (0.5+) adjust the "concentration" of the cave gen. Lower = larger voids
})} })}
val caveAttenuateBias = caveAttenuateBias0.let { val caveAttenuateBias1 = ModuleCache().also { it.setSource(ModuleBias().also {
it.setSource(highlandLowlandSelectCache)
it.setBias(params.caveAttenuateBias1) // (0.5+) adjust the "concentration" of the cave gen. Lower = larger voids
})}
val caveAttenuateBiasForTerr = caveAttenuateBias0.let {
ModuleScaleOffset().also { ModuleScaleOffset().also {
it.setSource(caveAttenuateBias0) it.setSource(caveAttenuateBias0)
it.setScale(params.caveAttenuateScale) it.setScale(params.caveAttenuateScale)
} }
} }
val caveAttenuateBiasForOres = caveAttenuateBias0.let {
ModuleScaleOffset().also {
it.setSource(caveAttenuateBias1)
it.setScale(params.caveAttenuateScale)
}
}
val caveShapeAttenuate = ModuleCombiner().also { val caveShapeAttenuate = ModuleCombiner().also {
it.setType(ModuleCombiner.CombinerType.MULT) it.setType(ModuleCombiner.CombinerType.MULT)
it.setSource(0, caveShape) it.setSource(0, caveShape)
it.setSource(1, caveAttenuateBias) it.setSource(1, caveAttenuateBiasForTerr)
} }
val cavePerturbFractal = ModuleFractal().also { val cavePerturbFractal = ModuleFractal().also {
@@ -660,7 +672,7 @@ internal object TerragenTest : NoiseMaker {
val caveBlockageAttenuate = ModuleCombiner().also { val caveBlockageAttenuate = ModuleCombiner().also {
it.setType(ModuleCombiner.CombinerType.MULT) it.setType(ModuleCombiner.CombinerType.MULT)
it.setSource(0, caveBlockageFractal) it.setSource(0, caveBlockageFractal)
it.setSource(1, caveAttenuateBias) it.setSource(1, caveAttenuateBiasForTerr)
} }
val caveBlockageSelect = ModuleSelect().also { val caveBlockageSelect = ModuleSelect().also {
@@ -711,7 +723,7 @@ internal object TerragenTest : NoiseMaker {
it.setScaleX(1.0 / params.featureSize) // adjust this value to change features size it.setScaleX(1.0 / params.featureSize) // adjust this value to change features size
it.setScaleY(1.0 / params.featureSize) it.setScaleY(1.0 / params.featureSize)
it.setScaleZ(1.0 / params.featureSize) it.setScaleZ(1.0 / params.featureSize)
it.setSource(caveAttenuateBias) it.setSource(caveAttenuateBiasForOres)
} }