This commit is contained in:
Anuken
2021-06-20 09:50:25 -04:00
parent 5d74795c02
commit 448d1e2c77
27 changed files with 63 additions and 84 deletions

View File

@@ -115,7 +115,7 @@ public abstract class PlanetGenerator extends BasicGenerator implements HexMeshe
@Override
protected float noise(float x, float y, double octaves, double falloff, double scl, double mag){
Vec3 v = sector.rect.project(x, y);
return (float)Simplex.noise3d(0, octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag;
return Simplex.noise3d(0, octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag;
}
/** @return the scaling factor for sector rects. */

View File

@@ -48,11 +48,11 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
}
float rawHeight(Vec3 position){
return (float)Simplex.noise3d(seed, octaves, persistence, 1f/heightScl, 10f + position.x, 10f + position.y, 10f + position.z);
return Simplex.noise3d(seed, octaves, persistence, 1f/heightScl, 10f + position.x, 10f + position.y, 10f + position.z);
}
float rawTemp(Vec3 position){
return position.dst(0, 0, 1)*2.2f - (float)Simplex.noise3d(seed, 8, 0.54f, 1.4f, 10f + position.x, 10f + position.y, 10f + position.z) * 2.9f;
return position.dst(0, 0, 1)*2.2f - Simplex.noise3d(seed, 8, 0.54f, 1.4f, 10f + position.x, 10f + position.y, 10f + position.z) * 2.9f;
}
Block getBlock(Vec3 position){
@@ -61,7 +61,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
float height = rawHeight(position);
Tmp.v31.set(position);
position = Tmp.v33.set(position).scl(scl);
float temp = (float)Simplex.noise3d(seed, 8, 0.6, 1f/2f, 10f + position.x, 10f + position.y + 99f, 10f + position.z);
float temp = Simplex.noise3d(seed, 8, 0.6, 1f/2f, 10f + position.x, 10f + position.y + 99f, 10f + position.z);
height *= 1.2f;
height = Mathf.clamp(height);

View File

@@ -57,7 +57,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
float rawHeight(Vec3 position){
position = Tmp.v33.set(position).scl(scl);
return (Mathf.pow((float)Simplex.noise3d(seed, 7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);
return (Mathf.pow(Simplex.noise3d(seed, 7, 0.5f, 1f/3f, position.x, position.y, position.z), 2.3f) + waterOffset) / (1f + waterOffset);
}
@Override
@@ -127,12 +127,12 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
position = Tmp.v33.set(position).scl(scl);
float rad = scl;
float temp = Mathf.clamp(Math.abs(position.y * 2f) / (rad));
float tnoise = (float)Simplex.noise3d(seed, 7, 0.56, 1f/3f, position.x, position.y + 999f, position.z);
float tnoise = Simplex.noise3d(seed, 7, 0.56, 1f/3f, position.x, position.y + 999f, position.z);
temp = Mathf.lerp(temp, tnoise, 0.5f);
height *= 1.2f;
height = Mathf.clamp(height);
float tar = (float)Simplex.noise3d(seed, 4, 0.55f, 1f/2f, position.x, position.y + 999f, position.z) * 0.3f + Tmp.v31.dst(0, 0, 1f) * 0.2f;
float tar = Simplex.noise3d(seed, 4, 0.55f, 1f/2f, position.x, position.y + 999f, position.z) * 0.3f + Tmp.v31.dst(0, 0, 1f) * 0.2f;
Block res = arr[Mathf.clamp((int)(temp * arr.length), 0, arr[0].length - 1)][Mathf.clamp((int)(height * arr[0].length), 0, arr[0].length - 1)];
if(tar > 0.5f){
@@ -145,7 +145,7 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
@Override
protected float noise(float x, float y, double octaves, double falloff, double scl, double mag){
Vec3 v = sector.rect.project(x, y).scl(5f);
return (float)Simplex.noise3d(seed, octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag;
return Simplex.noise3d(seed, octaves, falloff, 1f / scl, v.x, v.y, v.z) * (float)mag;
}
@Override

View File

@@ -36,7 +36,7 @@ public class TantrosPlanetGenerator extends PlanetGenerator{
@Override
public Color getColor(Vec3 position){
float depth = (float)Simplex.noise3d(seed, 2, 0.56, 1.7f, position.x, position.y, position.z) / 2f;
float depth = Simplex.noise3d(seed, 2, 0.56, 1.7f, position.x, position.y, position.z) / 2f;
return c1.write(out).lerp(c2, Mathf.clamp(Mathf.round(depth, 0.15f))).a(0.6f);
}
@@ -91,14 +91,14 @@ public class TantrosPlanetGenerator extends PlanetGenerator{
}
float rawHeight(Vec3 position){
return (float)Simplex.noise3d(seed, 8, 0.7f, 1f, position.x, position.y, position.z);
return Simplex.noise3d(seed, 8, 0.7f, 1f, position.x, position.y, position.z);
}
Block getBlock(Vec3 position){
float height = rawHeight(position);
Tmp.v31.set(position);
position = Tmp.v33.set(position).scl(2f);
float temp = (float)Simplex.noise3d(seed, 8, 0.6, 1f/2f, position.x, position.y + 99f, position.z);
float temp = Simplex.noise3d(seed, 8, 0.6, 1f/2f, position.x, position.y + 99f, position.z);
height *= 1.2f;
height = Mathf.clamp(height);