-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ver/6.5.0' into dev/7.0-2
- Loading branch information
Showing
30 changed files
with
1,125 additions
and
86 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...rovider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/api/Extrusion.java
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
4 changes: 2 additions & 2 deletions
4
...line/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/biome/SelfPipelineBiome.java
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
26 changes: 26 additions & 0 deletions
26
...in/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java
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,26 @@ | ||
package com.dfsek.terra.addons.noise.config.templates; | ||
|
||
import com.dfsek.tectonic.api.config.template.annotations.Value; | ||
import com.dfsek.tectonic.api.exception.ValidationException; | ||
|
||
import com.dfsek.terra.api.noise.DerivativeNoiseSampler; | ||
import com.dfsek.terra.api.noise.NoiseSampler; | ||
|
||
|
||
public class DerivativeNoiseSamplerTemplate extends SamplerTemplate<DerivativeNoiseSampler> { | ||
|
||
@Value(".") | ||
private NoiseSampler sampler; | ||
|
||
@Override | ||
public boolean validate() throws ValidationException { | ||
if(!DerivativeNoiseSampler.isDifferentiable(sampler)) throw new ValidationException( | ||
"Provided sampler does not support calculating a derivative"); | ||
return super.validate(); | ||
} | ||
|
||
@Override | ||
public DerivativeNoiseSampler get() { | ||
return (DerivativeNoiseSampler) sampler; | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
...ain/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeNoiseTemplate.java
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 @@ | ||
package com.dfsek.terra.addons.noise.config.templates.noise; | ||
|
||
import com.dfsek.terra.addons.noise.samplers.noise.DerivativeNoiseFunction; | ||
|
||
|
||
public abstract class DerivativeNoiseTemplate<T extends DerivativeNoiseFunction> extends NoiseTemplate<T> { | ||
|
||
} |
79 changes: 79 additions & 0 deletions
79
.../main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java
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,79 @@ | ||
package com.dfsek.terra.addons.noise.config.templates.noise; | ||
|
||
import com.dfsek.tectonic.api.config.template.annotations.Default; | ||
import com.dfsek.tectonic.api.config.template.annotations.Value; | ||
|
||
import com.dfsek.terra.addons.noise.samplers.noise.PseudoErosionSampler; | ||
import com.dfsek.terra.addons.noise.samplers.noise.simplex.OpenSimplex2Sampler; | ||
import com.dfsek.terra.api.config.meta.Meta; | ||
import com.dfsek.terra.api.noise.DerivativeNoiseSampler; | ||
|
||
|
||
public class PseudoErosionTemplate extends NoiseTemplate<PseudoErosionSampler> { | ||
@Value("frequency") | ||
@Default | ||
protected @Meta double frequency = 1d; | ||
|
||
@Value("octaves") | ||
@Default | ||
private int octaves = 4; | ||
|
||
@Value("lacunarity") | ||
@Default | ||
private double lacunarity = 2.0; | ||
|
||
@Value("gain") | ||
@Default | ||
private double gain = 0.5; | ||
|
||
@Value("slope-strength") | ||
@Default | ||
private double slopeStrength = 1.0; | ||
|
||
|
||
@Value("branch-strength") | ||
@Default | ||
private double branchStrength = 1.0; | ||
|
||
@Value("strength") | ||
@Default | ||
private double strength = 0.04; | ||
|
||
@Value("erosion-frequency") | ||
@Default | ||
private double erosionFrequency = 0.02; | ||
|
||
@Value("sampler") | ||
@Default | ||
private DerivativeNoiseSampler heightSampler = new OpenSimplex2Sampler(); | ||
|
||
@Value("slope-mask.enable") | ||
@Default | ||
private boolean slopeMask = true; | ||
|
||
@Value("slope-mask.none") | ||
@Default | ||
private double slopeMaskNone = -0.5; | ||
|
||
@Value("slope-mask.full") | ||
@Default | ||
private double slopeMaskFull = 1; | ||
|
||
@Value("jitter") | ||
@Default | ||
private double jitterModifier = 1; | ||
|
||
@Value("average-impulses") | ||
@Default | ||
private boolean averageErosionImpulses = true; | ||
|
||
@Override | ||
public PseudoErosionSampler get() { | ||
PseudoErosionSampler pseudoErosion = new PseudoErosionSampler(octaves, gain, lacunarity, | ||
slopeStrength, branchStrength, strength, | ||
erosionFrequency, heightSampler, slopeMask, slopeMaskFull, slopeMaskNone, jitterModifier, averageErosionImpulses); | ||
pseudoErosion.setFrequency(frequency); | ||
pseudoErosion.setSalt(salt); | ||
return pseudoErosion; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...on/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java
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,25 @@ | ||
package com.dfsek.terra.addons.noise.samplers.noise; | ||
|
||
import com.dfsek.terra.api.noise.DerivativeNoiseSampler; | ||
|
||
|
||
public abstract class DerivativeNoiseFunction extends NoiseFunction implements DerivativeNoiseSampler { | ||
@Override | ||
public boolean isDifferentiable() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public double[] noised(long seed, double x, double y) { | ||
return getNoiseDerivativeRaw(seed + salt, x * frequency, y * frequency); | ||
} | ||
|
||
@Override | ||
public double[] noised(long seed, double x, double y, double z) { | ||
return getNoiseDerivativeRaw(seed + salt, x * frequency, y * frequency, z * frequency); | ||
} | ||
|
||
public abstract double[] getNoiseDerivativeRaw(long seed, double x, double y); | ||
|
||
public abstract double[] getNoiseDerivativeRaw(long seed, double x, double y, double z); | ||
} |
Oops, something went wrong.