made connected lods dependant on Vertical Quality config.

This commit is contained in:
cola98765
2021-12-30 12:04:02 +01:00
parent 607f3e8afe
commit 13d6232790
2 changed files with 13 additions and 46 deletions
@@ -249,7 +249,7 @@ public class LodBuilder
yAbs = chunk.getMaxY(xRel,zRel) - MIN_WORLD_HEIGHT;
int count = 0;
boolean topBlock = true;
if (yAbs <= 0);
if (yAbs <= 0)
dataToMerge[index * verticalData] = DataPointUtil.createVoidDataPoint(generation);
while (yAbs > 0)
{
@@ -261,18 +261,11 @@ public class LodBuilder
yAbs = height - 1;
// We search light on above air block
depth = determineBottomPointFrom(chunk, config, xAbs, yAbs, zAbs, count < timesToEdgeDetect && !hasCeiling);
depth = determineBottomPointFrom(chunk, config, xAbs, yAbs, zAbs, count < this.config.client().graphics().quality().getVerticalQuality().maxConnectedLods && !hasCeiling);
if (hasCeiling && topBlock)
{
yAbs = depth;
light = getLightValue(chunk, xAbs,yAbs + MIN_WORLD_HEIGHT, zAbs, true, hasSkyLight, true);
color = generateLodColor(chunk, config, xAbs, yAbs, zAbs);
}
else
{
light = getLightValue(chunk, xAbs, yAbs + MIN_WORLD_HEIGHT, zAbs, hasCeiling, hasSkyLight, topBlock);
color = generateLodColor(chunk, config, xAbs, yAbs, zAbs);
}
light = getLightValue(chunk, xAbs,yAbs + MIN_WORLD_HEIGHT, zAbs, hasCeiling, hasSkyLight, topBlock);
color = generateLodColor(chunk, config, xAbs, yAbs, zAbs);
lightBlock = light & 0b1111;
lightSky = (light >> 4) & 0b1111;
isDefault = ((light >> 8)) == 1;
@@ -31,53 +31,27 @@ import org.jetbrains.annotations.Nullable;
public enum VerticalQuality
{
LOW(
new int[] { 2,
2,
2,
2,
1,
1,
1,
1,
1,
1,
1 }
new int[] { 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 },
0
),
MEDIUM(
new int[] { 4,
4,
2,
2,
2,
1,
1,
1,
1,
1,
1 }
new int[] { 4, 4, 2, 2, 2, 1, 1, 1, 1, 1, 1 },
1
),
HIGH(
new int[] {
8,
8,
4,
4,
2,
2,
2,
1,
1,
1,
1 }
new int[] { 8, 8, 4, 4, 2, 2, 2, 1, 1, 1, 1 },
2
);
public final int[] maxVerticalData;
public final int maxConnectedLods;
VerticalQuality(int[] maxVerticalData)
VerticalQuality(int[] maxVerticalData, int maxConnectedLods)
{
this.maxVerticalData = maxVerticalData;
this.maxConnectedLods = maxConnectedLods;
}
// Note: return null if out of range