mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-12 10:46:25 +00:00
Cache 2D noise results to increase performance, update to latest Gaea
This commit is contained in:
@@ -56,7 +56,7 @@ public class ImageLoader {
|
||||
BiomeZone z = TerraWorld.getWorld(w).getZone();
|
||||
for(int x = 0; x < newImg.getWidth(); x++) {
|
||||
for(int y = 0; y < newImg.getHeight(); y++) {
|
||||
float[] noise;
|
||||
double[] noise;
|
||||
if(align.equals(Align.CENTER))
|
||||
noise = tb.getGrid(x - original.getWidth() / 2, y - original.getHeight() / 2).getRawNoise(x - original.getWidth() / 2, y - original.getHeight() / 2);
|
||||
else noise = tb.getGrid(x, y).getRawNoise(x, y);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class WorldImageGenerator {
|
||||
int imX = 0;
|
||||
for(int x = centerX - (draw.getWidth() / 2); x < centerX + (draw.getWidth() / 2); x++) {
|
||||
int zone = NormalizationUtil.normalize(tw.getZone().getRawNoise(x, y), 256, 4);
|
||||
float[] noise = tb.getGrid(x, y).getRawNoise(x, y);
|
||||
double[] noise = tb.getGrid(x, y).getRawNoise(x, y);
|
||||
Color c = new Color(NormalizationUtil.normalize(noise[0], 256, 4), NormalizationUtil.normalize(noise[1], 256, 4), zone);
|
||||
draw.setRGB(imX, imY, c.getRGB());
|
||||
imX++;
|
||||
|
||||
Reference in New Issue
Block a user