aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-10 18:20:36 +0200
committermakamys <makamys@outlook.com>2021-05-10 18:20:36 +0200
commit6fe5960e676774379174b144a15cf099e82c630d (patch)
tree2ccc2d1698089bc4cab340611f4acee798da9275 /src/main/java/makamys/lodmod/renderer
parentaf95ea799a8a61aac0bcfbad49b691bfb374bca0 (diff)
downloadNeodymium-6fe5960e676774379174b144a15cf099e82c630d.tar.gz
Neodymium-6fe5960e676774379174b144a15cf099e82c630d.tar.bz2
Neodymium-6fe5960e676774379174b144a15cf099e82c630d.zip
Make seabeds darker
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer')
-rw-r--r--src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
index fea3e22..4afd9d2 100644
--- a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
+++ b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java
@@ -71,10 +71,11 @@ public class SimpleChunkMesh extends Mesh {
int waterColor = biome.getWaterColorMultiplier();
waterColor |= 0xFF000000;
- pass2.addFaceYPos(worldX, worldY, worldZ, size, size, waterIcon, waterColor);
+ pass2.addFaceYPos(worldX, worldY, worldZ, size, size, waterIcon, waterColor, 1);
}
if(block.isBlockNormalCube() && block.isOpaqueCube() && block.renderAsNormalBlock()) {
+ float brightnessMult = foundWater ? 0.2f : 1f;
int meta = target.getBlockMetadata(xOff, y, zOff);
icon = block.getIcon(1, meta);
@@ -88,10 +89,10 @@ public class SimpleChunkMesh extends Mesh {
color = (0xFF << 24) | ((color >> 16 & 0xFF) << 0) | ((color >> 8 & 0xFF) << 8) | ((color >> 0 & 0xFF) << 16);
if(biome.getFloatTemperature(worldX, y, worldZ) < 0.15f) {
- pass1.addCube(worldX, worldY + 0.2f, worldZ, size, size, 1f, Blocks.snow_layer.getIcon(1, 0), Blocks.snow_layer.colorMultiplier(target.worldObj, worldX, y, worldZ));
- pass1.addCube(worldX, worldY - 0.8f, worldZ, size, size, worldY - 0.8f, icon, color);
+ pass1.addCube(worldX, worldY + 0.2f, worldZ, size, size, 1f, Blocks.snow_layer.getIcon(1, 0), Blocks.snow_layer.colorMultiplier(target.worldObj, worldX, y, worldZ), brightnessMult);
+ pass1.addCube(worldX, worldY - 0.8f, worldZ, size, size, worldY - 0.8f, icon, color, brightnessMult);
} else {
- pass1.addCube(worldX, worldY, worldZ, size, size, worldY, icon, color);
+ pass1.addCube(worldX, worldY, worldZ, size, size, worldY, icon, color, brightnessMult);
}
@@ -127,45 +128,45 @@ public class SimpleChunkMesh extends Mesh {
instances++;
}
- private void addCube(float x, float y, float z, float sizeX, float sizeZ, float sizeY, IIcon icon, int color) {
- addFaceYPos(x, y, z, sizeX, sizeZ, icon, color);
+ private void addCube(float x, float y, float z, float sizeX, float sizeZ, float sizeY, IIcon icon, int color, float brightnessMult) {
+ addFaceYPos(x, y, z, sizeX, sizeZ, icon, color, brightnessMult);
addFace(
x + 0, y - sizeY, z + 0,
x + 0, y + 0, z + 0,
x + sizeX, y + 0, z + 0,
x + sizeX, y - sizeY, z + 0,
- icon, color, 200
+ icon, color, (int)(200 * brightnessMult)
);
addFace(
x + sizeX, y - sizeY, z + sizeZ,
x + sizeX, y + 0, z + sizeZ,
x + 0, y + 0, z + sizeZ,
x + 0, y - sizeY, z + sizeZ,
- icon, color, 200
+ icon, color, (int)(200 * brightnessMult)
);
addFace(
x + sizeX, y - sizeY, z + 0,
x + sizeX, y + 0, z + 0,
x + sizeX, y + 0, z + sizeZ,
x + sizeX, y - sizeY, z + sizeZ,
- icon, color, 160
+ icon, color, (int)(160 * brightnessMult)
);
addFace(
x + 0, y - sizeY, z + sizeZ,
x + 0, y + 0, z + sizeZ,
x + 0, y + 0, z + 0,
x + 0, y - sizeY, z + 0,
- icon, color, 160
+ icon, color, (int)(160 * brightnessMult)
);
}
- private void addFaceYPos(float x, float y, float z, float sizeX, float sizeZ, IIcon icon, int color) {
+ private void addFaceYPos(float x, float y, float z, float sizeX, float sizeZ, IIcon icon, int color, float brightnessMult) {
addFace(
x + 0, y + 0, z + 0,
x + 0, y + 0, z + sizeZ,
x + sizeX, y + 0, z + sizeZ,
x + sizeX, y + 0, z + 0,
- icon, color, 240
+ icon, color, (int)(240 * brightnessMult)
);
}