aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/render/GT_Renderer_Block.java
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-03-23 21:05:47 +0100
committerGitHub <noreply@github.com>2021-03-23 21:05:47 +0100
commitec07c1015ecd2ddae86b91ef759d6f7fcb0d5611 (patch)
treec4e7cc8cf098bc169d9dd09f2ec51f4195137a13 /src/main/java/gregtech/common/render/GT_Renderer_Block.java
parente9e5a7be3d38c7ec07cb94f058fdf8e9f398befd (diff)
parente6f726c7fa14413b8f57c2a7e2583cfd486fb8d1 (diff)
downloadGT5-Unofficial-ec07c1015ecd2ddae86b91ef759d6f7fcb0d5611.tar.gz
GT5-Unofficial-ec07c1015ecd2ddae86b91ef759d6f7fcb0d5611.tar.bz2
GT5-Unofficial-ec07c1015ecd2ddae86b91ef759d6f7fcb0d5611.zip
Merge pull request #473 from GTNewHorizons/patch_inner_side_detection
fix(rendering): brightness of no-z-fighting offset faces
Diffstat (limited to 'src/main/java/gregtech/common/render/GT_Renderer_Block.java')
-rw-r--r--src/main/java/gregtech/common/render/GT_Renderer_Block.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/gregtech/common/render/GT_Renderer_Block.java b/src/main/java/gregtech/common/render/GT_Renderer_Block.java
index e95f508d80..2f33a80dca 100644
--- a/src/main/java/gregtech/common/render/GT_Renderer_Block.java
+++ b/src/main/java/gregtech/common/render/GT_Renderer_Block.java
@@ -20,8 +20,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
+import static gregtech.api.util.LightingHelper.NO_Z_FIGHT_OFFSET;
+
public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
- private static final float NoZFightOffset = 1.0F / 16384.0F;
public static GT_Renderer_Block INSTANCE;
public final int mRenderID;
@@ -305,7 +306,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tIcons[3], false);
}
if (tIsCovered[0]) {
- aBlock.setBlockBounds(0.0F, 0.0F + NoZFightOffset, 0.0F, 1.0F, 0.125F, 1.0F);
+ aBlock.setBlockBounds(0.0F, 0.0F + NO_Z_FIGHT_OFFSET, 0.0F, 1.0F, 0.125F, 1.0F);
aRenderer.setRenderBoundsFromBlock(aBlock);
renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[0], false);
@@ -323,7 +324,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
if (tIsCovered[1]) {
- aBlock.setBlockBounds(0.0F, 0.875F, 0.0F, 1.0F, 1.0F - NoZFightOffset, 1.0F);
+ aBlock.setBlockBounds(0.0F, 0.875F, 0.0F, 1.0F, 1.0F - NO_Z_FIGHT_OFFSET, 1.0F);
aRenderer.setRenderBoundsFromBlock(aBlock);
renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[1], false);
@@ -341,7 +342,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
if (tIsCovered[2]) {
- aBlock.setBlockBounds(0.0F, 0.0F, 0.0F + NoZFightOffset, 1.0F, 1.0F, 0.125F);
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F + NO_Z_FIGHT_OFFSET, 1.0F, 1.0F, 0.125F);
aRenderer.setRenderBoundsFromBlock(aBlock);
if (!tIsCovered[0]) {
renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[2], false);
@@ -359,7 +360,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
if (tIsCovered[3]) {
- aBlock.setBlockBounds(0.0F, 0.0F, 0.875F, 1.0F, 1.0F, 1.0F - NoZFightOffset);
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.875F, 1.0F, 1.0F, 1.0F - NO_Z_FIGHT_OFFSET);
aRenderer.setRenderBoundsFromBlock(aBlock);
if (!tIsCovered[0]) {
renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[3], false);
@@ -377,7 +378,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
if (tIsCovered[4]) {
- aBlock.setBlockBounds(0.0F + NoZFightOffset, 0.0F, 0.0F, 0.125F, 1.0F, 1.0F);
+ aBlock.setBlockBounds(0.0F + NO_Z_FIGHT_OFFSET, 0.0F, 0.0F, 0.125F, 1.0F, 1.0F);
aRenderer.setRenderBoundsFromBlock(aBlock);
if (!tIsCovered[0]) {
renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
@@ -395,7 +396,7 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[4], false);
}
if (tIsCovered[5]) {
- aBlock.setBlockBounds(0.875F, 0.0F, 0.0F, 1.0F - NoZFightOffset, 1.0F, 1.0F);
+ aBlock.setBlockBounds(0.875F, 0.0F, 0.0F, 1.0F - NO_Z_FIGHT_OFFSET, 1.0F, 1.0F);
aRenderer.setRenderBoundsFromBlock(aBlock);
if (!tIsCovered[0]) {
renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tCovers[5], false);