Permalink
Browse files

Fixed z-fighting issue on the inside of hollow facades and reduced th…

…e offset a bit to reduce long-range fighting
  • Loading branch information...
1 parent f112d90 commit eb78ff7efa98de96bef528c3cd9640df07ef0991 @Krapht Krapht committed Jul 15, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 buildcraft_client/net/minecraft/src/buildcraft/transport/PipeWorldRenderer.java
@@ -159,7 +159,7 @@ public void renderPipe(RenderBlocks renderblocks, IBlockAccess iblockaccess, Blo
private void pipeFacadeRenderer(RenderBlocks renderblocks, Block block, PipeRenderState state, int x, int y, int z) {
float facadeThickness = 1F / 16F;
- float zFightOffset = 1F / 8192F;
+ float zFightOffset = 1F / 4096F;
float[][] zeroState = new float[3][2];
//X START - END
@@ -182,7 +182,7 @@ private void pipeFacadeRenderer(RenderBlocks renderblocks, Block block, PipeRend
float[][] rotated = deepClone(zeroState);
rotated[2][0] = 0.0F;
rotated[2][1] = Utils.pipeMinPos;
- rotated[1][0] -= zFightOffset/2;
+ rotated[1][0] -= zFightOffset / 2;
transform(rotated, direction);
block.setBlockBounds(rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1], rotated[2][1]);
renderblocks.renderStandardBlock(block, x, y, z);
@@ -197,13 +197,15 @@ private void pipeFacadeRenderer(RenderBlocks renderblocks, Block block, PipeRend
rotated = deepClone(zeroState);
rotated[0][0] = 0.0F;
rotated[0][1] = Utils.pipeMinPos;
+ rotated[1][1] -= zFightOffset;
transform(rotated, direction);
block.setBlockBounds(rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1], rotated[2][1]);
renderblocks.renderStandardBlock(block, x, y, z);
rotated = deepClone(zeroState);
rotated[0][0] = Utils.pipeMaxPos;
rotated[0][1] = 1F;
+ rotated[1][1] -= zFightOffset;
transform(rotated, direction);
block.setBlockBounds(rotated[0][0], rotated[1][0], rotated[2][0], rotated[0][1], rotated[1][1], rotated[2][1]);
renderblocks.renderStandardBlock(block, x, y, z);

0 comments on commit eb78ff7

Please sign in to comment.