Merge pull request #960 from CocoTheOwner/render-continent

Continent (i.e. heightmap + ocean/land division) render
This commit is contained in:
Brian Fopiano 2023-02-15 14:47:14 -08:00 committed by GitHub
commit f5c64c7480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -49,6 +49,14 @@ public class IrisRenderer {
colorFunction = (x, z) -> renderer.getComplex().getCaveBiomeStream().get(x, z).getColor(renderer, currentType).getRGB();
case HEIGHT ->
colorFunction = (x, z) -> Color.getHSBColor(renderer.getComplex().getHeightStream().get(x, z).floatValue(), 100, 100).getRGB();
case CONTINENT -> {
double fluidHeight = renderer.getComplex().getFluidHeight();
int deltaHeight = renderer.getMaxHeight() - renderer.getMinHeight();
colorFunction = (x, z) -> {
double h = renderer.getComplex().getHeightStream().get(x, z);
return new Color((int) (h * 255d / deltaHeight), 128, h > fluidHeight ? 0 : 255).getRGB();
};
}
}
double x, z;

View File

@ -19,5 +19,5 @@
package com.volmit.iris.core.gui.components;
public enum RenderType {
BIOME, BIOME_LAND, BIOME_SEA, REGION, CAVE_LAND, HEIGHT, OBJECT_LOAD, DECORATOR_LOAD, LAYER_LOAD
BIOME, BIOME_LAND, BIOME_SEA, REGION, CAVE_LAND, HEIGHT, OBJECT_LOAD, DECORATOR_LOAD, CONTINENT, LAYER_LOAD
}