mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-17 22:00:08 +00:00
Cache 2D noise results to increase performance, update to latest Gaea
This commit is contained in:
@@ -18,7 +18,7 @@ public class CoordinatePerturb {
|
||||
* @param amplitude Offset amplitude
|
||||
* @param seed Noise seed
|
||||
*/
|
||||
public CoordinatePerturb(float frequency, int amplitude, long seed) {
|
||||
public CoordinatePerturb(double frequency, int amplitude, long seed) {
|
||||
perturbX = new FastNoiseLite((int) seed);
|
||||
perturbX.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
|
||||
perturbX.setFrequency(frequency);
|
||||
|
||||
@@ -9,7 +9,7 @@ public class ErosionNoise {
|
||||
private final double thresh;
|
||||
private final FastNoiseLite noise;
|
||||
|
||||
public ErosionNoise(float freq1, double thresh, int octaves, long seed) {
|
||||
public ErosionNoise(double freq1, double thresh, int octaves, long seed) {
|
||||
FastNoiseLite main = new FastNoiseLite((int) (seed + 1));
|
||||
main.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
|
||||
main.setFractalType(FastNoiseLite.FractalType.FBm);
|
||||
|
||||
@@ -20,7 +20,7 @@ public class TerraBiomeGrid extends BiomeGrid {
|
||||
|
||||
private final BiomeZone zone;
|
||||
|
||||
public TerraBiomeGrid(World w, float freq1, float freq2, BiomeZone zone, ConfigPack c, UserDefinedGrid erosion) {
|
||||
public TerraBiomeGrid(World w, double freq1, double freq2, BiomeZone zone, ConfigPack c, UserDefinedGrid erosion) {
|
||||
super(w, freq1, freq2, 0, 0);
|
||||
if(c.biomeBlend) {
|
||||
perturb = new CoordinatePerturb(c.blendFreq, c.blendAmp, w.getSeed());
|
||||
|
||||
@@ -15,7 +15,7 @@ public class UserDefinedGrid extends BiomeGrid {
|
||||
private final ImageLoader.Channel channelX;
|
||||
private final ImageLoader.Channel channelZ;
|
||||
|
||||
public UserDefinedGrid(World w, float freq1, float freq2, UserDefinedBiome[][] b, WorldConfig c) {
|
||||
public UserDefinedGrid(World w, double freq1, double freq2, UserDefinedBiome[][] b, WorldConfig c) {
|
||||
super(w, freq1, freq2, b.length, b[0].length);
|
||||
super.setGrid(b);
|
||||
imageLoader = c.imageLoader;
|
||||
|
||||
Reference in New Issue
Block a user