mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-21 15:50:40 +00:00
Update to latest Gaea, allow configuration of terrain octaves/frequency
This commit is contained in:
@@ -54,9 +54,9 @@ public class ImageLoader {
|
||||
float[] 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);
|
||||
newImg.setRGB(x, y, new Color((int) (NormalizationUtil.normalize(noise[0], tb.getGrid(x, y).getSizeX()) * ((double) 255 / tb.getGrid(x, y).getSizeX())),
|
||||
(int) (NormalizationUtil.normalize(noise[1], tb.getGrid(x, y).getSizeZ()) * ((double) 255 / tb.getGrid(x, y).getSizeZ())),
|
||||
(int) (NormalizationUtil.normalize(z.getNoise(x, y), z.getSize()) * ((double) 255 / z.getSize())))
|
||||
newImg.setRGB(x, y, new Color((int) (NormalizationUtil.normalize(noise[0], tb.getGrid(x, y).getSizeX(), 4) * ((double) 255 / tb.getGrid(x, y).getSizeX())),
|
||||
(int) (NormalizationUtil.normalize(noise[1], tb.getGrid(x, y).getSizeZ(), 4) * ((double) 255 / tb.getGrid(x, y).getSizeZ())),
|
||||
(int) (NormalizationUtil.normalize(z.getNoise(x, y), z.getSize(), 4) * ((double) 255 / z.getSize())))
|
||||
.getRGB());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ public class WorldImageGenerator {
|
||||
for(int y = centerZ - (draw.getHeight()/2); y < centerZ + (draw.getHeight()/2); y++) {
|
||||
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);
|
||||
int zone = NormalizationUtil.normalize(tw.getZone().getRawNoise(x, y), 256, 4);
|
||||
float[] noise = tb.getGrid(x, y).getRawNoise(x, y);
|
||||
Color c = new Color(NormalizationUtil.normalize(noise[0], 256), NormalizationUtil.normalize(noise[1], 256), zone);
|
||||
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