Fixed regions wall not showing (which would cause holes in the rendering) and added border as possible overdraw config

This commit is contained in:
Leonardo
2021-10-21 12:57:40 +02:00
parent e0a176c0c4
commit be024f524d
5 changed files with 14 additions and 8 deletions
@@ -280,8 +280,6 @@ public class LodBufferBuilder
int posZ;
int xAdj;
int zAdj;
int chunkXdist;
int chunkZdist;
int bufferIndex;
Box box = ThreadMapUtil.getBox();
boolean[] adjShadeDisabled = ThreadMapUtil.getAdjShadeDisabledArray();
@@ -365,11 +363,12 @@ public class LodBufferBuilder
//Other wise we check if this position is
data = lodDim.getSingleData(detailLevel, xAdj, zAdj);
adjData.get(direction)[0] = DataPointUtil.EMPTY_DATA;
if (isThisPositionGoingToBeRendered(detailLevel, xAdj, zAdj, playerChunkPos, vanillaRenderedChunks, gameChunkRenderDistance)
&& !DataPointUtil.isVoid(data))
{
adjShadeDisabled[Box.DIRECTION_INDEX.get(direction)] = DataPointUtil.getAlpha(data) < 255;
adjData.get(direction)[0] = DataPointUtil.EMPTY_DATA;
}
}
}
@@ -494,13 +493,13 @@ public class LodBufferBuilder
// check if the chunk is on the border
boolean isItBorderPos;
if (LodConfig.CLIENT.graphics.advancedGraphicsOption.vanillaOverdraw.get() == VanillaOverdraw.NEVER)
if (LodConfig.CLIENT.graphics.advancedGraphicsOption.vanillaOverdraw.get() == VanillaOverdraw.BORDER)
isItBorderPos = LodUtil.isBorderChunk(vanillaRenderedChunks, chunkXdist + gameChunkRenderDistance + 1, chunkZdist + gameChunkRenderDistance + 1);
else
isItBorderPos = false;
boolean smallRenderDistance = gameChunkRenderDistance <= LodUtil.MINIMUM_RENDER_DISTANCE_FOR_PARTIAL_OVERDRAW;
//boolean smallRenderDistance = gameChunkRenderDistance <= LodUtil.MINIMUM_RENDER_DISTANCE_FOR_PARTIAL_OVERDRAW;
// get the positions that will be rendered
@@ -510,7 +509,7 @@ public class LodBufferBuilder
&& vanillaRenderedChunks[chunkXdist + gameChunkRenderDistance + 1][chunkZdist + gameChunkRenderDistance + 1];
return (vanillaRenderedPosition && (!(isItBorderPos && smallRenderDistance)));
return (vanillaRenderedPosition && (!(isItBorderPos)));
}
@@ -270,7 +270,8 @@ public class LodConfig
+ " " + " More effective on higher render distances. \n"
+ " " + " For vanilla render distances less than or equal to " + LodUtil.MINIMUM_RENDER_DISTANCE_FOR_PARTIAL_OVERDRAW + " \n"
+ " " + " " + VanillaOverdraw.NEVER + " or " + VanillaOverdraw.ALWAYS + " may be used depending on the dimension. \n"
+ " " + VanillaOverdraw.ALWAYS + ": LODs will render on all vanilla chunks preventing holes in the world. \n")
+ " " + VanillaOverdraw.ALWAYS + ": LODs will render on all vanilla chunks preventing holes in the world. \n"
+ " " + VanillaOverdraw.BORDER + ": LODs will render only on the border of vanilla chunks preventing only some holes in the world. \n")
.defineEnum("Vanilla Overdraw", VanillaOverdraw.DYNAMIC);
builder.pop();
}
@@ -39,4 +39,7 @@ public enum VanillaOverdraw
/** Draw LODs over all minecraft chunks. */
ALWAYS,
/** Draw LODs over border chunks. */
BORDER,
}
@@ -530,12 +530,14 @@ public class LodRenderer
*/
private void setupProjectionMatrix(Matrix4f currentProjectionMatrix, float partialTicks)
{
//Minimum radious of view in 2 render distance
int minDistance = 8;
// create the new projection matrix
Matrix4f lodPoj =
Matrix4f.perspective(
getFov(partialTicks, true),
(float) this.mc.getWindow().getScreenWidth() / (float) this.mc.getWindow().getScreenHeight(),
mc.getRenderDistance() / 2,
minDistance,
farPlaneBlockDistance * LodUtil.CHUNK_WIDTH / 2);
// get Minecraft's un-edited projection matrix
@@ -411,6 +411,7 @@ public class LodUtil
break;
default:
case BORDER:
case NEVER:
// skip chunks in render distance that are rendered
// by vanilla minecraft