This commit is contained in:
Daniel Mills 2020-08-03 12:31:13 -04:00
parent ef5115b76c
commit 51d55eed05
3 changed files with 11 additions and 39 deletions

View File

@ -9,7 +9,7 @@ public class IrisSettings
@DontObfuscate @DontObfuscate
@Desc("Iris generator threads (must be 2 or higher).") @Desc("Iris generator threads (must be 2 or higher).")
public int threads = 128; public int threads = 16;
@DontObfuscate @DontObfuscate
@Desc("Compress parallax data in memory to reduce memory usage in exchange for more cpu usage.") @Desc("Compress parallax data in memory to reduce memory usage in exchange for more cpu usage.")

View File

@ -180,7 +180,6 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
if(getDimension().isPlaceObjects()) if(getDimension().isPlaceObjects())
{ {
onGenerateParallax(random, x, z); onGenerateParallax(random, x, z);
injectBiomeSky(x, z, grid);
getParallaxChunk(x, z).inject(data); getParallaxChunk(x, z).inject(data);
setSliverBuffer(getSliverCache().size()); setSliverBuffer(getSliverCache().size());
getParallaxChunk(x, z).setWorldGenerated(true); getParallaxChunk(x, z).setWorldGenerated(true);
@ -194,39 +193,6 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
Iris.data.getObjectLoader().clean(); Iris.data.getObjectLoader().clean();
} }
protected void injectBiomeSky(int x, int z, BiomeGrid grid)
{
if(getDimension().isInverted())
{
return;
}
int rx;
int rz;
for(int i = 0; i < 16; i++)
{
rx = (x * 16) + i;
for(int j = 0; j < 16; j++)
{
rz = (z * 16) + j;
int min = sampleSliver(rx, rz).getHighestBiome();
int max = getParallaxSliver(rx, rz).getHighestBlock();
if(min < max)
{
IrisBiome biome = getCachedInternalBiome(i, j);
for(int g = min; g <= max; g++)
{
grid.setBiome(i, g, j, biome.getSkyBiome(masterRandom, rz, g, rx));
}
}
}
}
}
protected void onGenerateParallax(RNG random, int x, int z) protected void onGenerateParallax(RNG random, int x, int z)
{ {
String key = "par." + x + "." + "z"; String key = "par." + x + "." + "z";

View File

@ -87,17 +87,23 @@ public abstract class PostBlockChunkGenerator extends ParallaxChunkGenerator imp
{ {
int rxx = rx; int rxx = rx;
int rzz = (z << 4) + j; int rzz = (z << 4) + j;
int hh = h;
for(IrisPostBlockFilter f : filters) getAccelerant().queue("post", () ->
{ {
if(f.getPhase() == h) for(IrisPostBlockFilter f : filters)
{ {
f.onPost(rxx, rzz); if(f.getPhase() == hh)
{
f.onPost(rxx, rzz);
}
} }
} });
} }
} }
getAccelerant().waitFor("post");
for(IrisPostBlockFilter f : filters) for(IrisPostBlockFilter f : filters)
{ {
if(f.getPhase() == h) if(f.getPhase() == h)