9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 02:59:06 +00:00
This commit is contained in:
cyberpwn
2022-09-11 23:00:15 -04:00
parent 044403b829
commit 06d9f279ac
4 changed files with 10040 additions and 29 deletions

View File

@@ -175,8 +175,7 @@ public class IrisComplex implements DataProvider {
heightStream = ProceduralStream.of((x, z) -> {
IrisBiome b = focusBiome != null ? focusBiome : baseBiomeStream.get(x, z);
return getHeight(engine, b, x, z, engine.getSeedManager().getHeight());
}, Interpolated.DOUBLE).clamp(0, engine.getHeight()).cache2D("heightStream", engine, cacheSize)
.waste("Height Stream")
}, Interpolated.DOUBLE).cache2D("heightStream", engine, cacheSize).waste("Height Stream")
.contextInjecting((c,x,z)->c.getHeight().get(x, z));
roundedHeighteightStream = heightStream.round().waste("Rounded Height Stream")
.contextInjecting((c,x,z)->(int)Math.round(c.getHeight().get(x, z)));
@@ -324,7 +323,7 @@ public class IrisComplex implements DataProvider {
}
return 0;
});
});;
double d = 0;

File diff suppressed because it is too large Load Diff

View File

@@ -22,31 +22,7 @@ import com.volmit.iris.util.function.NoiseProvider;
public class Starcast {
public static double starcast(int x, int z, double r, double checks, boolean optimized, NoiseProvider n) {
if(optimized) {
if(checks == 3) return sc3(x, z, r, n);
else if(checks == 5) return sc5(x, z, r, n);
else if(checks == 6) return sc6(x, z, r, n);
else if(checks == 7) return sc7(x, z, r, n);
else if(checks == 9) return sc9(x, z, r, n);
else if(checks == 12) return sc12(x, z, r, n);
else if(checks == 24) return sc24(x, z, r, n);
else if(checks == 32) return sc32(x, z, r, n);
else if(checks == 48) return sc48(x, z, r, n);
else if(checks == 64) return sc64(x, z, r, n);
}
double m = 360D / checks;
double v = 0;
for(int i = 0; i < 360; i += m) {
double sin = Math.sin(Math.toRadians(i));
double cos = Math.cos(Math.toRadians(i));
double cx = x + ((r * cos) - (r * sin));
double cz = z + ((r * sin) + (r * cos));
v += n.noise(cx, cz);
}
return v / checks;
return CompiledStarcast.getStarcast((float)x, (float)z, (float)r, (float)checks, n);
}
public static double starcast(int x, int z, double r, double checks, NoiseProvider n) {

View File

@@ -138,6 +138,7 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
}
default ProceduralStream<T> contextInjecting(Function3<ChunkContext, Integer, Integer, T> contextAccessor) {
//return this;
return new ContextInjectingStream<>(this, contextAccessor);
}
@@ -146,7 +147,8 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
}
default ProceduralStream<T> waste(String name) {
return new WasteDetector<T>(this, name);
return this;
//return new WasteDetector<T>(this, name);
}
default ProceduralStream<T> subtract(ProceduralStream<Double> a) {