diff --git a/api/src/main/java/com/seibel/lod/api/enums/config/ELightGenerationMode.java b/api/src/main/java/com/seibel/lod/api/enums/config/ELightGenerationMode.java index 8518b74d1..8d945689d 100644 --- a/api/src/main/java/com/seibel/lod/api/enums/config/ELightGenerationMode.java +++ b/api/src/main/java/com/seibel/lod/api/enums/config/ELightGenerationMode.java @@ -24,7 +24,7 @@ package com.seibel.lod.api.enums.config; * FANCY, * * @author Leetom - * @version 2022-7-1 + * @version 2023-6-7 */ public enum ELightGenerationMode { @@ -32,9 +32,8 @@ public enum ELightGenerationMode // when adding items up the API minor version // when removing items up the API major version - /** Fake light values using a height map */ - FAST, + DISTANT_HORIZONS, + + MINECRAFT - /** Run the lighting engine though the chunk to generate proper light values */ - FANCY } diff --git a/api/src/main/java/com/seibel/lod/api/enums/config/EServerFolderNameMode.java b/api/src/main/java/com/seibel/lod/api/enums/config/EServerFolderNameMode.java index da4bda15b..b4aa4dd52 100644 --- a/api/src/main/java/com/seibel/lod/api/enums/config/EServerFolderNameMode.java +++ b/api/src/main/java/com/seibel/lod/api/enums/config/EServerFolderNameMode.java @@ -21,10 +21,10 @@ package com.seibel.lod.api.enums.config; /** - * AUTO,
* NAME_ONLY,
* NAME_IP,
- * NAME_IP_PORT,

+ * NAME_IP_PORT,
+ * NAME_IP_PORT_MC_VERSION,

* * Determines how the multiplayer folders should be named. * @@ -38,12 +38,6 @@ public enum EServerFolderNameMode // when removing items up the API major version - /** - * NAME_IP for LAN connections
- * NAME_IP_PORT for all others - */ - AUTO, - /** Only use the server name */ NAME_ONLY, diff --git a/api/src/main/java/com/seibel/lod/api/enums/config/quickOptions/EQuickQuality.java b/api/src/main/java/com/seibel/lod/api/enums/config/quickOptions/EQuickQuality.java new file mode 100644 index 000000000..daf4e182e --- /dev/null +++ b/api/src/main/java/com/seibel/lod/api/enums/config/quickOptions/EQuickQuality.java @@ -0,0 +1,45 @@ +/* + * This file is part of the Distant Horizons mod (formerly the LOD Mod), + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2022 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.lod.api.enums.config.quickOptions; + +/** + * CUSTOM,

+ * + * MINIMUM,
+ * LOW,
+ * MEDIUM,
+ * HIGH,
+ * EXTREME,
+ */ +public enum EQuickQuality +{ + // Reminder: + // when adding items up the API minor version + // when removing items up the API major version + + CUSTOM, + + MINIMUM, + LOW, + MEDIUM, + HIGH, + EXTREME; + +} \ No newline at end of file diff --git a/api/src/main/java/com/seibel/lod/api/enums/config/quickOptions/EQuickThread.java b/api/src/main/java/com/seibel/lod/api/enums/config/quickOptions/EQuickThread.java new file mode 100644 index 000000000..c712922d9 --- /dev/null +++ b/api/src/main/java/com/seibel/lod/api/enums/config/quickOptions/EQuickThread.java @@ -0,0 +1,45 @@ +/* + * This file is part of the Distant Horizons mod (formerly the LOD Mod), + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2022 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.lod.api.enums.config.quickOptions; + +/** + * CUSTOM,

+ * + * MINIMAL_IMPACT,
+ * LOW_IMPACT,
+ * BALANCED,
+ * FAST_LOADING,
+ * I_PAID_FOR_THE_WHOLE_CPU,
+ */ +public enum EQuickThread +{ + // Reminder: + // when adding items up the API minor version + // when removing items up the API major version + + CUSTOM, + + MINIMAL_IMPACT, + LOW_IMPACT, + BALANCED, + FAST_LOADING, + I_PAID_FOR_THE_WHOLE_CPU; + +} \ No newline at end of file diff --git a/api/src/main/java/com/seibel/lod/api/enums/rendering/EDebugMode.java b/api/src/main/java/com/seibel/lod/api/enums/rendering/EDebugMode.java index ac30a42c9..cfae31adb 100644 --- a/api/src/main/java/com/seibel/lod/api/enums/rendering/EDebugMode.java +++ b/api/src/main/java/com/seibel/lod/api/enums/rendering/EDebugMode.java @@ -20,20 +20,15 @@ package com.seibel.lod.api.enums.rendering; /** - * OFF,
- * SHOW_WIREFRAME,
- * SHOW_DETAIL,
- * SHOW_DETAIL_WIREFRAME,
- * SHOW_GENMODE,
- * SHOW_GENMODE_WIREFRAME,
- * SHOW_OVERLAPPING_QUADS,
- * SHOW_OVERLAPPING_QUADS_WIREFRAME,
- * SHOW_RENDER_SOURCE_FLAG,
- * SHOW_RENDER_SOURCE_FLAG_WIREFRAME,
+ * OFF,
+ * SHOW_DETAIL,
+ * SHOW_GENMODE,
+ * SHOW_OVERLAPPING_QUADS,
+ * SHOW_RENDER_SOURCE_FLAG,
* * @author Leetom * @author James Seibel - * @version 2022-7-2 + * @version 2023-6-7 */ public enum EDebugMode { @@ -44,68 +39,40 @@ public enum EDebugMode /** LODs are rendered normally */ OFF, - - /** LOD draws in wireframe. */ - SHOW_WIREFRAME, /** LOD colors are based on their detail */ SHOW_DETAIL, - /** LOD colors are based on their detail, and draws in wireframe. */ - SHOW_DETAIL_WIREFRAME, - /** LOD colors are based on their gen mode. */ SHOW_GENMODE, - /** LOD colors are based on their gen mode, and draws in wireframe. */ - SHOW_GENMODE_WIREFRAME, - /** Only draw overlapping LOD quads. */ SHOW_OVERLAPPING_QUADS, - - /** Only draw overlapping LOD quads, and draws in wireframe. */ - SHOW_OVERLAPPING_QUADS_WIREFRAME, - + /** LOD colors are based on renderSource flags. */ - SHOW_RENDER_SOURCE_FLAG, - - /** LOD colors are based on renderSource flags, and draws in wireframe. */ - SHOW_RENDER_SOURCE_FLAG_WIREFRAME; - - /** returns the next debug mode */ - // Deprecated: use DebugMode.next() instead - @Deprecated - public EDebugMode getNext() + SHOW_RENDER_SOURCE_FLAG; + + + public static EDebugMode next(EDebugMode type) { - return next(this); - } - - public static EDebugMode next(EDebugMode type) { - switch (type) { - case OFF: return SHOW_WIREFRAME; - case SHOW_WIREFRAME: return SHOW_DETAIL; - case SHOW_DETAIL: return SHOW_DETAIL_WIREFRAME; - case SHOW_DETAIL_WIREFRAME: return SHOW_GENMODE; - case SHOW_GENMODE: return SHOW_GENMODE_WIREFRAME; - case SHOW_GENMODE_WIREFRAME: return SHOW_OVERLAPPING_QUADS; - case SHOW_OVERLAPPING_QUADS: return SHOW_OVERLAPPING_QUADS_WIREFRAME; - case SHOW_OVERLAPPING_QUADS_WIREFRAME: return SHOW_RENDER_SOURCE_FLAG; - case SHOW_RENDER_SOURCE_FLAG: return SHOW_RENDER_SOURCE_FLAG_WIREFRAME; + switch (type) + { + case OFF: return SHOW_DETAIL; + case SHOW_DETAIL: return SHOW_GENMODE; + case SHOW_GENMODE: return SHOW_OVERLAPPING_QUADS; + case SHOW_OVERLAPPING_QUADS: return SHOW_RENDER_SOURCE_FLAG; default: return OFF; } } - public static EDebugMode previous(EDebugMode type) { - switch (type) { - case OFF: return SHOW_RENDER_SOURCE_FLAG_WIREFRAME; - case SHOW_RENDER_SOURCE_FLAG_WIREFRAME: return SHOW_RENDER_SOURCE_FLAG; - case SHOW_RENDER_SOURCE_FLAG: return SHOW_OVERLAPPING_QUADS_WIREFRAME; - case SHOW_OVERLAPPING_QUADS_WIREFRAME: return SHOW_OVERLAPPING_QUADS; - case SHOW_OVERLAPPING_QUADS: return SHOW_GENMODE_WIREFRAME; - case SHOW_GENMODE_WIREFRAME: return SHOW_GENMODE; - case SHOW_GENMODE: return SHOW_DETAIL_WIREFRAME; - case SHOW_DETAIL_WIREFRAME: return SHOW_DETAIL; - case SHOW_DETAIL: return SHOW_WIREFRAME; + public static EDebugMode previous(EDebugMode type) + { + switch (type) + { + case OFF: return SHOW_RENDER_SOURCE_FLAG; + case SHOW_RENDER_SOURCE_FLAG: return SHOW_OVERLAPPING_QUADS; + case SHOW_OVERLAPPING_QUADS: return SHOW_GENMODE; + case SHOW_GENMODE: return SHOW_DETAIL; default: return OFF; } } diff --git a/api/src/main/java/com/seibel/lod/api/interfaces/config/both/IDhApiWorldGenerationConfig.java b/api/src/main/java/com/seibel/lod/api/interfaces/config/both/IDhApiWorldGenerationConfig.java index d50679f97..e9f8b51c6 100644 --- a/api/src/main/java/com/seibel/lod/api/interfaces/config/both/IDhApiWorldGenerationConfig.java +++ b/api/src/main/java/com/seibel/lod/api/interfaces/config/both/IDhApiWorldGenerationConfig.java @@ -46,12 +46,6 @@ public interface IDhApiWorldGenerationConfig extends IDhApiConfigGroup /** Defines to what level fake chunks will be generated. */ IDhApiConfigValue getDistantGeneratorMode(); - /** Defines how generated fake chunks will be lit. */ - IDhApiConfigValue getLightingMode(); - - /** Defines the order in which fake chunks will be generated. */ - IDhApiConfigValue getGenerationPriority(); - /** * Defines what blocks will be ignored when generating LODs.

* diff --git a/api/src/main/java/com/seibel/lod/api/interfaces/config/client/IDhApiGraphicsConfig.java b/api/src/main/java/com/seibel/lod/api/interfaces/config/client/IDhApiGraphicsConfig.java index a8cb99fa5..db6b2a485 100644 --- a/api/src/main/java/com/seibel/lod/api/interfaces/config/client/IDhApiGraphicsConfig.java +++ b/api/src/main/java/com/seibel/lod/api/interfaces/config/client/IDhApiGraphicsConfig.java @@ -81,7 +81,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup * 2 = blending of 5x5
* ...
*/ - IDhApiConfigValue getBiomeBlending(); +// IDhApiConfigValue getBiomeBlending(); @@ -89,15 +89,6 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup // advanced graphic settings // //===========================// - /** If directional culling is disabled fake chunks will be rendered behind the camera. */ - IDhApiConfigValue getDisableDirectionalCulling(); - - /** Determines how fake chunks are rendered in comparison to vanilla MC's chunks. */ - IDhApiConfigValue getVanillaOverdraw(); - - /** Modifies how far the vanilla overdraw is rendered in chunks. */ - IDhApiConfigValue getVanillaOverdrawOffset(); - /** * If enabled the near clip plane is extended to reduce * overdraw and improve Z-fighting at extreme render distances.
@@ -130,9 +121,6 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup /** If enabled vanilla chunk rendering is disabled and only fake chunks are rendered. */ IDhApiConfigValue getEnableLodOnlyMode(); - /** Defines how often the geometry should be rebuilt when the player moves. */ - IDhApiConfigValue getGeometryRebuildFrequency(); - } diff --git a/api/src/main/java/com/seibel/lod/api/interfaces/config/client/IDhApiGraphicsFogConfig.java b/api/src/main/java/com/seibel/lod/api/interfaces/config/client/IDhApiGraphicsFogConfig.java index 37035826d..a060a316e 100644 --- a/api/src/main/java/com/seibel/lod/api/interfaces/config/client/IDhApiGraphicsFogConfig.java +++ b/api/src/main/java/com/seibel/lod/api/interfaces/config/client/IDhApiGraphicsFogConfig.java @@ -87,7 +87,7 @@ public interface IDhApiGraphicsFogConfig extends IDhApiConfigGroup IDhApiConfigValue getFogMaxThickness(); /** Defines how the fog changes in thickness. */ - IDhApiConfigValue getFogFalloff(); + IDhApiConfigValue getFarFogFalloff(); /** Defines the fog density. */ IDhApiConfigValue getFogDensity(); diff --git a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/both/DhApiWorldGenerationConfig.java b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/both/DhApiWorldGenerationConfig.java index aff18f21f..f88dc0aee 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/both/DhApiWorldGenerationConfig.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/both/DhApiWorldGenerationConfig.java @@ -22,7 +22,7 @@ package com.seibel.lod.core.api.external.methods.config.both; import com.seibel.lod.api.interfaces.config.IDhApiConfigValue; import com.seibel.lod.api.interfaces.config.both.IDhApiWorldGenerationConfig; import com.seibel.lod.api.objects.config.DhApiConfigValue; -import com.seibel.lod.core.config.Config.Client.WorldGenerator; +import com.seibel.lod.core.config.Config.Client.Advanced.WorldGenerator; import com.seibel.lod.api.enums.config.EBlocksToAvoid; import com.seibel.lod.api.enums.worldGeneration.EDhApiDistantGeneratorMode; import com.seibel.lod.api.enums.config.EGenerationPriority; @@ -52,14 +52,6 @@ public class DhApiWorldGenerationConfig implements IDhApiWorldGenerationConfig public IDhApiConfigValue getDistantGeneratorMode() { return new DhApiConfigValue<>(WorldGenerator.distantGeneratorMode); } - @Override - public IDhApiConfigValue getLightingMode() - { return new DhApiConfigValue<>(WorldGenerator.lightGenerationMode); } - - @Override - public IDhApiConfigValue getGenerationPriority() - { return new DhApiConfigValue<>(WorldGenerator.generationPriority); } - @Deprecated @Override public IDhApiConfigValue getBlocksToAvoid() diff --git a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiBuffersConfig.java b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiBuffersConfig.java index 46d5501a4..b1b33a9b3 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiBuffersConfig.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiBuffersConfig.java @@ -22,7 +22,8 @@ package com.seibel.lod.core.api.external.methods.config.client; import com.seibel.lod.api.interfaces.config.IDhApiConfigValue; import com.seibel.lod.api.interfaces.config.client.IDhApiBuffersConfig; import com.seibel.lod.api.objects.config.DhApiConfigValue; -import com.seibel.lod.core.config.Config.Client.Advanced.Buffers; +import com.seibel.lod.core.config.Config; +import com.seibel.lod.core.config.Config.Client.Advanced.GpuBuffers; import com.seibel.lod.api.enums.config.EGpuUploadMethod; /** @@ -40,9 +41,9 @@ public class DhApiBuffersConfig implements IDhApiBuffersConfig public IDhApiConfigValue getGpuUploadMethod() - { return new DhApiConfigValue<>(Buffers.gpuUploadMethod); } + { return new DhApiConfigValue<>(Config.Client.Advanced.GpuBuffers.gpuUploadMethod); } public IDhApiConfigValue getBufferUploadTimeoutPerMegabyteInMilliseconds() - { return new DhApiConfigValue<>(Buffers.gpuUploadPerMegabyteInMilliseconds); } + { return new DhApiConfigValue<>(GpuBuffers.gpuUploadPerMegabyteInMilliseconds); } } diff --git a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiGraphicsConfig.java b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiGraphicsConfig.java index ef9cc6e9f..6abc59fd2 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiGraphicsConfig.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiGraphicsConfig.java @@ -26,9 +26,9 @@ import com.seibel.lod.api.objects.config.DhApiConfigValue; import com.seibel.lod.coreapi.util.converters.RenderModeEnabledConverter; import com.seibel.lod.core.config.Config; import com.seibel.lod.api.enums.rendering.ERendererMode; -import com.seibel.lod.core.config.Config.Client.Graphics.Quality; +import com.seibel.lod.core.config.Config.Client.Advanced.Graphics.Quality; import com.seibel.lod.core.config.Config.Client.Advanced.Debugging; -import com.seibel.lod.core.config.Config.Client.Graphics.AdvancedGraphics; +import com.seibel.lod.core.config.Config.Client.Advanced.Graphics.AdvancedGraphics; /** * Distant Horizons' graphics/rendering configuration. @@ -78,9 +78,9 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig public IDhApiConfigValue getHorizontalQualityDropoff() { return new DhApiConfigValue<>(Quality.horizontalQuality); } - @Override - public IDhApiConfigValue getBiomeBlending() - { return new DhApiConfigValue<>(Quality.lodBiomeBlending); } +// @Override +// public IDhApiConfigValue getBiomeBlending() +// { return new DhApiConfigValue<>(Quality.lodBiomeBlending); } @@ -88,17 +88,9 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig // advanced graphic settings // //===========================// - @Override - public IDhApiConfigValue getDisableDirectionalCulling() - { return new DhApiConfigValue<>(AdvancedGraphics.disableDirectionalCulling); } - - @Override - public IDhApiConfigValue getVanillaOverdraw() - { return new DhApiConfigValue<>(AdvancedGraphics.vanillaOverdraw); } - - @Override - public IDhApiConfigValue getVanillaOverdrawOffset() - { return new DhApiConfigValue<>(AdvancedGraphics.overdrawOffset); } +// @Override +// public IDhApiConfigValue getDisableDirectionalCulling() +// { return new DhApiConfigValue<>(AdvancedGraphics.disableDirectionalCulling); } @Override public IDhApiConfigValue getUseExtendedNearClipPlane() @@ -126,11 +118,7 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig @Override public IDhApiConfigValue getEnableLodOnlyMode() - { return new DhApiConfigValue<>(Config.Client.Advanced.lodOnlyMode); } - - @Override - public IDhApiConfigValue getGeometryRebuildFrequency() - { return new DhApiConfigValue<>(Config.Client.Advanced.Buffers.rebuildTimes); } + { return new DhApiConfigValue<>(Debugging.lodOnlyMode); } diff --git a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiGraphicsFogConfig.java b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiGraphicsFogConfig.java index 98190a8c6..1f2210d45 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiGraphicsFogConfig.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiGraphicsFogConfig.java @@ -23,7 +23,7 @@ import com.seibel.lod.api.enums.rendering.*; import com.seibel.lod.api.interfaces.config.IDhApiConfigValue; import com.seibel.lod.api.interfaces.config.client.IDhApiGraphicsFogConfig; import com.seibel.lod.api.objects.config.DhApiConfigValue; -import com.seibel.lod.core.config.Config.Client.Graphics.FogQuality; +import com.seibel.lod.core.config.Config.Client.Advanced.Graphics.Fog; /** * Distant Horizons' fog configuration.

@@ -49,19 +49,19 @@ public class DhApiGraphicsFogConfig implements IDhApiGraphicsFogConfig @Override public IDhApiConfigValue getFogDistance() - { return new DhApiConfigValue<>(FogQuality.fogDistance); } + { return new DhApiConfigValue<>(Fog.fogDistance); } @Override public IDhApiConfigValue getFogRender() - { return new DhApiConfigValue<>(FogQuality.fogDrawMode); } + { return new DhApiConfigValue<>(Fog.fogDrawMode); } @Override public IDhApiConfigValue getFogColor() - { return new DhApiConfigValue<>(FogQuality.fogColorMode); } + { return new DhApiConfigValue<>(Fog.fogColorMode); } @Override public IDhApiConfigValue getDisableVanillaFog() - { return new DhApiConfigValue<>(FogQuality.disableVanillaFog); } + { return new DhApiConfigValue<>(Fog.disableVanillaFog); } //=======================// @@ -70,27 +70,27 @@ public class DhApiGraphicsFogConfig implements IDhApiGraphicsFogConfig @Override public IDhApiConfigValue getFogStartDistance() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.farFogStart); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.farFogStart); } @Override public IDhApiConfigValue getFogEndDistance() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.farFogEnd); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.farFogEnd); } @Override public IDhApiConfigValue getFogMinThickness() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.farFogMin); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.farFogMin); } @Override public IDhApiConfigValue getFogMaxThickness() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.farFogMax); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.farFogMax); } @Override - public IDhApiConfigValue getFogFalloff() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.farFogType); } + public IDhApiConfigValue getFarFogFalloff() + { return new DhApiConfigValue<>(Fog.AdvancedFog.farFogFalloff); } @Override public IDhApiConfigValue getFogDensity() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.farFogDensity); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.farFogDensity); } //=====================// @@ -99,38 +99,38 @@ public class DhApiGraphicsFogConfig implements IDhApiGraphicsFogConfig @Override public IDhApiConfigValue getHeightFogMixMode() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogMixMode); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogMixMode); } @Override public IDhApiConfigValue getHeightFogMode() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogMode); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogMode); } @Override public IDhApiConfigValue getHeightFogBaseHeight() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogHeight); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogHeight); } @Override public IDhApiConfigValue getHeightFogStartingHeightPercent() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogStart); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogStart); } @Override public IDhApiConfigValue getHeightFogEndingHeightPercent() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogEnd); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogEnd); } @Override public IDhApiConfigValue getHeightFogMinThickness() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogMin); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogMin); } @Override public IDhApiConfigValue getHeightFogMaxThickness() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogMax); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogMax); } @Override public IDhApiConfigValue getHeightFogFalloff() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogType); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogFalloff); } @Override public IDhApiConfigValue getHeightFogDensity() - { return new DhApiConfigValue<>(FogQuality.AdvancedFog.HeightFog.heightFogDensity); } + { return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogDensity); } } diff --git a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiMultiplayerConfig.java b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiMultiplayerConfig.java index 0f6765810..6cf1feac7 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiMultiplayerConfig.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiMultiplayerConfig.java @@ -22,7 +22,7 @@ package com.seibel.lod.core.api.external.methods.config.client; import com.seibel.lod.api.interfaces.config.IDhApiConfigValue; import com.seibel.lod.api.interfaces.config.client.IDhApiMultiplayerConfig; import com.seibel.lod.api.objects.config.DhApiConfigValue; -import com.seibel.lod.core.config.Config.Client.Multiplayer; +import com.seibel.lod.core.config.Config.Client.Advanced.Multiplayer; import com.seibel.lod.api.enums.config.EServerFolderNameMode; /** diff --git a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiThreadingConfig.java b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiThreadingConfig.java index ff5531dc4..746f02083 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiThreadingConfig.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/methods/config/client/DhApiThreadingConfig.java @@ -22,7 +22,7 @@ package com.seibel.lod.core.api.external.methods.config.client; import com.seibel.lod.api.interfaces.config.IDhApiConfigValue; import com.seibel.lod.api.interfaces.config.client.IDhApiThreadingConfig; import com.seibel.lod.api.objects.config.DhApiConfigValue; -import com.seibel.lod.core.config.Config.Client.Advanced.Threading; +import com.seibel.lod.core.config.Config.Client.Advanced.MultiThreading; /** * Distant Horizons' threading configuration. @@ -40,18 +40,18 @@ public class DhApiThreadingConfig implements IDhApiThreadingConfig @Override public IDhApiConfigValue getWorldGeneratorThread() - { return new DhApiConfigValue<>(Threading.numberOfWorldGenerationThreads); } + { return new DhApiConfigValue<>(MultiThreading.numberOfWorldGenerationThreads); } @Override public IDhApiConfigValue getBufferBuilderThread() - { return new DhApiConfigValue<>(Threading.numberOfBufferBuilderThreads); } + { return new DhApiConfigValue<>(MultiThreading.numberOfBufferBuilderThreads); } @Override public IDhApiConfigValue getFileHandlerThread() - { return new DhApiConfigValue<>(Threading.numberOfFileHandlerThreads); } + { return new DhApiConfigValue<>(MultiThreading.numberOfFileHandlerThreads); } @Override public IDhApiConfigValue getDataConverterThread() - { return new DhApiConfigValue<>(Threading.numberOfDataConverterThreads); } + { return new DhApiConfigValue<>(MultiThreading.numberOfDataConverterThreads); } } diff --git a/core/src/main/java/com/seibel/lod/core/config/Config.java b/core/src/main/java/com/seibel/lod/core/config/Config.java index 1836cb902..8ae2b1ccc 100644 --- a/core/src/main/java/com/seibel/lod/core/config/Config.java +++ b/core/src/main/java/com/seibel/lod/core/config/Config.java @@ -21,26 +21,28 @@ package com.seibel.lod.core.config; import com.seibel.lod.api.enums.config.*; +import com.seibel.lod.api.enums.config.quickOptions.EQuickQuality; +import com.seibel.lod.api.enums.config.quickOptions.EQuickThread; import com.seibel.lod.api.enums.rendering.*; import com.seibel.lod.api.enums.worldGeneration.EDhApiDistantGeneratorMode; import com.seibel.lod.core.config.eventHandlers.RenderCacheConfigEventHandler; import com.seibel.lod.core.config.types.*; import com.seibel.lod.core.config.types.enums.*; +import com.seibel.lod.coreapi.ModInfo; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * This handles any configuration the user has access to. + * * @author coolGi - * @version 04-29-2022 + * @version 2023-6-7 */ public class Config { + // TODO update this diagram // CONFIG STRUCTURE // -> Client // | @@ -48,13 +50,13 @@ public class Config // | |-> Quality // | |-> FogQuality // | |-> AdvancedGraphics - // | |-> NoiseSettings + // | |-> NoiseTextureSettings // | // |-> World Generation // | // |-> Advanced // |-> Threads - // |-> Buffers + // |-> GpuBuffers // |-> Debugging // Since the original config system uses forge stuff, that means we have to rewrite the whole config system @@ -64,691 +66,707 @@ public class Config public static class Client { - public static ConfigCategory graphics = new ConfigCategory.Builder().set(Graphics.class).build(); - - public static ConfigCategory worldGenerator = new ConfigCategory.Builder().set(WorldGenerator.class).build(); - - public static ConfigCategory multiplayer = new ConfigCategory.Builder().set(Multiplayer.class).build(); - - public static ConfigCategory advanced = new ConfigCategory.Builder().set(Advanced.class).build(); - - public static ConfigCategory autoUpdater = new ConfigCategory.Builder().set(AutoUpdater.class).build(); - - public static ConfigEntry optionsButton = new ConfigEntry.Builder() - .set(true) - .comment("Show the lod button in the options screen next to fov") - .build(); - -// public static ConfigEntry> testHashMap = new ConfigEntry.Builder>() -// .set(new HashMap()) -// .build(); - - - public static class Graphics - { - public static ConfigCategory quality = new ConfigCategory.Builder().set(Quality.class).build(); - - public static ConfigCategory fogQuality = new ConfigCategory.Builder().set(FogQuality.class).build(); - - public static ConfigCategory advancedGraphics = new ConfigCategory.Builder().set(AdvancedGraphics.class).build(); - - - public static class Quality - { - public static ConfigEntry drawResolution = new ConfigEntry.Builder() - .set(EHorizontalResolution.BLOCK) - .comment("" - + "What is the maximum detail fake chunks should be drawn at? \n" - + "This setting will only affect closer chunks.\n" - + "Higher settings will increase memory and GPU usage. \n" - + "\n" - + EHorizontalResolution.CHUNK + ": render 1 LOD for each Chunk. \n" - + EHorizontalResolution.HALF_CHUNK + ": render 4 LODs for each Chunk. \n" - + EHorizontalResolution.FOUR_BLOCKS + ": render 16 LODs for each Chunk. \n" - + EHorizontalResolution.TWO_BLOCKS + ": render 64 LODs for each Chunk. \n" - + EHorizontalResolution.BLOCK + ": render 256 LODs for each Chunk (width of one block). \n" - + "\n" - + "Lowest Quality: " + EHorizontalResolution.CHUNK + "\n" - + "Highest Quality: " + EHorizontalResolution.BLOCK) - .addListener(RenderCacheConfigEventHandler.INSTANCE) - .build(); - - public static ConfigEntry lodChunkRenderDistance = new ConfigEntry.Builder() - .setMinDefaultMax(32, 128, 4096) - .comment("The radius of the mod's render distance. (measured in chunks)") - .build(); - - public static ConfigEntry verticalQuality = new ConfigEntry.Builder() - .set(EVerticalQuality.MEDIUM) - .comment("" - + "This indicates how detailed fake chunks will represent \n" - + " overhangs, caves, floating islands, ect. \n" - + "Higher options will make the world more accurate, but" - + " will increase memory and GPU usage. \n" - + "\n" - + EVerticalQuality.LOW + ": uses at max 2 columns per position. \n" - + EVerticalQuality.MEDIUM + ": uses at max 4 columns per position. \n" - + EVerticalQuality.HIGH + ": uses at max 8 columns per position. \n" - + "\n" - + "Lowest Quality: " + EVerticalQuality.LOW + "\n" - + "Highest Quality: " + EVerticalQuality.HIGH) - .addListener(RenderCacheConfigEventHandler.INSTANCE) - .build(); - - public static ConfigEntry horizontalScale = new ConfigEntry.Builder() - .setMinDefaultMax(2, 12, 64) - .comment("" - + "This indicates how quickly fake chunks decrease in quality the further away they are. \n" - + "Higher settings will render higher quality fake chunks farther away, \n" - + " but will increase memory and GPU usage.") - .build(); - - public static ConfigEntry horizontalQuality = new ConfigEntry.Builder() - .set(EHorizontalQuality.MEDIUM) - .comment("" - + "This indicates how quickly fake chunks decrease in quality the further away they are. \n" - + "Higher settings will render higher quality fake chunks farther away, \n" - + " but will increase memory and GPU usage.") - .build(); - - public static ConfigEntry transparency = new ConfigEntry.Builder() - .set(ETransparency.COMPLETE) - .comment("") - .build(); - - public static ConfigEntry lodBiomeBlending = new ConfigEntry.Builder() - .setMinDefaultMax(0,1,7) - .comment("" - + "This is the same as vanilla Biome Blending settings for Lod area. \n" - + " Note that anything other than '0' will greatly effect Lod building time \n" - + " and increase triangle count. The cost on chunk generation speed is also \n" - + " quite large if set too high.\n" - + "\n" - + " '0' equals to Vanilla Biome Blending of '1x1' or 'OFF', \n" - + " '1' equals to Vanilla Biome Blending of '3x3', \n" - + " '2' equals to Vanilla Biome Blending of '5x5'...") - .build(); - } - - - public static class FogQuality - { - public static ConfigEntry fogDistance = new ConfigEntry.Builder() - .set(EFogDistance.FAR) - .comment("At what distance should Fog be drawn on the fake chunks?") - .setPerformance(ConfigEntryPerformance.NONE) - .build(); - - public static ConfigEntry fogDrawMode = new ConfigEntry.Builder() - .set(EFogDrawMode.FOG_ENABLED) - .comment("" - + "When should fog be drawn? \n" - + "\n" - + EFogDrawMode.USE_OPTIFINE_SETTING + ": Use whatever Fog setting Optifine is using.\n" - + "If Optifine isn't installed this defaults to " + EFogDrawMode.FOG_ENABLED + ". \n" - + EFogDrawMode.FOG_ENABLED + ": Never draw fog on the LODs \n" - + EFogDrawMode.FOG_DISABLED + ": Always draw fast fog on the LODs \n" - + "\n" - + "Disabling fog will improve GPU performance.") - .build(); - - public static ConfigEntry fogColorMode = new ConfigEntry.Builder() - .set(EFogColorMode.USE_WORLD_FOG_COLOR) - .comment("" - + "What color should fog use? \n" - + "\n" - + EFogColorMode.USE_WORLD_FOG_COLOR + ": Use the world's fog color. \n" - + EFogColorMode.USE_SKY_COLOR + ": Use the sky's color. \n" - + "\n" - + "This setting doesn't affect performance.") - .build(); - - public static ConfigEntry disableVanillaFog = new ConfigEntry.Builder() - .set(true) - .comment("" - + "If true disable Minecraft's fog. \n" - + "\n" - + "Experimental! Mod support is not guarantee.") - .build(); - - public static ConfigCategory advancedFog = new ConfigCategory.Builder().set(AdvancedFog.class).build(); - - - public static class AdvancedFog { - // TODO: Make some of the option here floats rather than doubles (the ClassicConfigGUI doesnt support floats) - private static final Double FOG_RANGE_MIN = 0.0; - private static final Double FOG_RANGE_MAX = Math.sqrt(2.0); - - public static ConfigEntry farFogStart = new ConfigEntry.Builder() - .setMinDefaultMax(FOG_RANGE_MIN, 0.0, FOG_RANGE_MAX) - .comment("" - + "Where should the far fog start? \n" - + "\n" - + " '0.0': Fog start at player's position.\n" - + " '1.0': The fog-start's circle fit just in the lod render distance square.\n" - + " '1.414': The lod render distance square fit just in the fog-start's circle.") - .build(); - - public static ConfigEntry farFogEnd = new ConfigEntry.Builder() - .setMinDefaultMax(FOG_RANGE_MIN, 1.0, FOG_RANGE_MAX) - .comment("" - + "Where should the far fog end? \n" - + "\n" - + " '0.0': Fog end at player's position.\n" - + " '1.0': The fog-end's circle fit just in the lod render distance square.\n" - + " '1.414': The lod render distance square fit just in the fog-end's circle.") - .build(); - - public static ConfigEntry farFogMin = new ConfigEntry.Builder() - .setMinDefaultMax(-5.0,0.0, FOG_RANGE_MAX) - .comment("" - + "What is the minimum fog thickness? \n" - + "\n" - + " '0.0': No fog at all.\n" - + " '1.0': Fully fog color.") - .build(); - - public static ConfigEntry farFogMax = new ConfigEntry.Builder() - .setMinDefaultMax(FOG_RANGE_MIN, 1.0, 5.0) - .comment("" - + "What is the maximum fog thickness? \n" - + "\n" - + " '0.0': No fog at all.\n" - + " '1.0': Fully fog color.") - .build(); - - public static ConfigEntry farFogType = new ConfigEntry.Builder() - .set(EFogFalloff.EXPONENTIAL_SQUARED) - .comment("" - + "How should the fog thickness should be calculated? \n" - + "\n" - + EFogFalloff.LINEAR + ": Linear based on distance (will ignore 'density')\n" - + EFogFalloff.EXPONENTIAL + ": 1/(e^(distance*density)) \n" - + EFogFalloff.EXPONENTIAL_SQUARED + ": 1/(e^((distance*density)^2)") - .build(); - - public static ConfigEntry farFogDensity = new ConfigEntry.Builder() - .setMinDefaultMax(0.01,2.5, 50.0) - .comment("What is the fog density?") - .build(); - - public static ConfigCategory heightFog = new ConfigCategory.Builder().set(HeightFog.class).build(); - - - public static class HeightFog { - public static ConfigEntry heightFogMixMode = new ConfigEntry.Builder() - .set(EHeightFogMixMode.BASIC) - .comment("" - + "How the height should effect the fog thickness combined with the normal function? \n" - + "\n" - + EHeightFogMixMode.BASIC + ": No special height fog effect. Fog is calculated based on camera distance \n" - + EHeightFogMixMode.IGNORE_HEIGHT + ": Ignore height completely. Fog is calculated based on horizontal distance \n" - + EHeightFogMixMode.ADDITION + ": heightFog + farFog \n" - + EHeightFogMixMode.MAX + ": max(heightFog, farFog) \n" - + EHeightFogMixMode.MULTIPLY + ": heightFog * farFog \n" - + EHeightFogMixMode.INVERSE_MULTIPLY + ": 1 - (1-heightFog) * (1-farFog) \n" - + EHeightFogMixMode.LIMITED_ADDITION + ": farFog + max(farFog, heightFog) \n" - + EHeightFogMixMode.MULTIPLY_ADDITION + ": farFog + farFog * heightFog \n" - + EHeightFogMixMode.INVERSE_MULTIPLY_ADDITION + ": farFog + 1 - (1-heightFog) * (1-farFog) \n" - + EHeightFogMixMode.AVERAGE + ": farFog*0.5 + heightFog*0.5 \n" - + "\n" - + "Note that for 'BASIC' mode and 'IGNORE_HEIGHT' mode, fog settings for height fog has no effect.") - .build(); - - public static ConfigEntry heightFogMode = new ConfigEntry.Builder() - .set(EHeightFogMode.ABOVE_AND_BELOW_CAMERA) - .comment("" - + "Where should the height fog be located? \n" - + "\n" - + EHeightFogMode.ABOVE_CAMERA + ": Height fog starts from camera to the sky \n" - + EHeightFogMode.BELOW_CAMERA + ": Height fog starts from camera to the void \n" - + EHeightFogMode.ABOVE_AND_BELOW_CAMERA + ": Height fog starts from camera to both the sky and the void \n" - + EHeightFogMode.ABOVE_SET_HEIGHT + ": Height fog starts from a set height to the sky \n" - + EHeightFogMode.BELOW_SET_HEIGHT + ": Height fog starts from a set height to the void \n" - + EHeightFogMode.ABOVE_AND_BELOW_SET_HEIGHT + ": Height fog starts from a set height to both the sky and the void") - .build(); - - public static ConfigEntry heightFogHeight = new ConfigEntry.Builder() - .setMinDefaultMax(-4096.0, 70.0, 4096.0) - .comment("If the height fog is calculated around a set height, what is that height position?") - .build(); - - public static ConfigEntry heightFogStart = new ConfigEntry.Builder() - .setMinDefaultMax(FOG_RANGE_MIN, 0.0, FOG_RANGE_MAX) - .comment("" - + "How far the start of height fog should offset? \n" - + "\n" - + " '0.0': Fog start with no offset.\n" - + " '1.0': Fog start with offset of the entire world's height. (Include depth)") - .build(); - - public static ConfigEntry heightFogEnd = new ConfigEntry.Builder() - .setMinDefaultMax(FOG_RANGE_MIN, 1.0, FOG_RANGE_MAX) - .comment("" - + "How far the end of height fog should offset? \n" - + "\n" - + " '0.0': Fog end with no offset.\n" - + " '1.0': Fog end with offset of the entire world's height. (Include depth)") - .build(); - - public static ConfigEntry heightFogMin = new ConfigEntry.Builder() - .setMinDefaultMax(-5.0, 0.0, FOG_RANGE_MAX) - .comment("" - + "What is the minimum fog thickness? \n" - + "\n" - + " '0.0': No fog at all.\n" - + " '1.0': Fully fog color.") - .build(); - - public static ConfigEntry heightFogMax = new ConfigEntry.Builder() - .setMinDefaultMax(FOG_RANGE_MIN, 1.0, 5.0) - .comment("" - + "What is the maximum fog thickness? \n" - + "\n" - + " '0.0': No fog at all.\n" - + " '1.0': Fully fog color.") - .build(); - - public static ConfigEntry heightFogType = new ConfigEntry.Builder() - .set(EFogFalloff.EXPONENTIAL_SQUARED) - .comment("" - + "How the fog thickness should be calculated from height? \n" - + "\n" - + EFogFalloff.LINEAR + ": Linear based on height (will ignore 'density')\n" - + EFogFalloff.EXPONENTIAL + ": 1/(e^(height*density)) \n" - + EFogFalloff.EXPONENTIAL_SQUARED + ": 1/(e^((height*density)^2)") - .build(); - - public static ConfigEntry heightFogDensity = new ConfigEntry.Builder() - .setMinDefaultMax(0.01, 2.5, 50.0) - .comment("What is the fog density?") - .build(); - - } - } - } - - - public static class AdvancedGraphics - { - public static ConfigEntry disableDirectionalCulling = new ConfigEntry.Builder() - .set(false) - .comment("" - + "If false fake chunks behind the player's camera \n" - + " aren't drawn, increasing GPU performance. \n" - + "\n" - + "If true all LODs are drawn, even those behind \n" - + " the player's camera, decreasing GPU performance. \n" - + "\n" - + "Disable this if you see LODs disappearing at the corners of your vision.") - .build(); - - public static ConfigEntry vanillaOverdraw = new ConfigEntry.Builder() - .set(EVanillaOverdraw.ALWAYS) - .comment("" - + " How often should LODs be drawn on top of regular chunks? \n" - + " ALWAYS will prevent holes in the world, \n" - + " but may look odd for transparent blocks or in caves. \n" - + "\n" - + EVanillaOverdraw.NEVER + ": \n" - + " LODs won't render on top of vanilla chunks. Use Overdraw offset to change the border offset. \n" - + EVanillaOverdraw.DYNAMIC + ": \n" - + " LODs will render on top of distant vanilla chunks to hide delayed loading. \n" - + " Will dynamically decide the border offset based on vanilla render distance. \n" - + EVanillaOverdraw.ALWAYS + ": \n" - + " LODs will render on all vanilla chunks preventing all holes in the world.") - .setPerformance(ConfigEntryPerformance.NONE) - .build(); - - public static ConfigEntry overdrawOffset = new ConfigEntry.Builder() - .setMinDefaultMax(-16, 0, 16) - .comment("" - + "If on Vanilla Overdraw mode of NEVER, how much should should the border be offset? \n" - + "\n" - + " '1': The start of lods will be shifted inwards by 1 chunk, causing 1 chunk of overdraw. \n" - + " '-1': The start fo lods will be shifted outwards by 1 chunk, causing 1 chunk of gap. \n" - + "\n" - + "This setting can be used to deal with gaps due to our vanilla rendered chunk \n" - + " detection not being perfect.") - .build(); - - public static ConfigEntry useExtendedNearClipPlane = new ConfigEntry.Builder() - .set(true) - .comment("" - + "Will prevent some overdraw issues, but may cause nearby fake chunks to render incorrectly \n" - + " especially when in/near an ocean.") - .setPerformance(ConfigEntryPerformance.NONE) - .build(); - - public static ConfigEntry brightnessMultiplier = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats) - .set(1.0) - .comment("" - + "How bright fake chunk colors are. \n" - + "\n" - + " 0 = black \n" - + " 1 = normal \n" - + " 2 = near white") - .build(); - - public static ConfigEntry saturationMultiplier = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats) - .set(1.0) - .comment("" - + "How saturated fake chunk colors are. \n" - + "\n" - + " 0 = black and white \n" - + " 1 = normal \n" - + " 2 = very saturated") - .build(); - - public static ConfigEntry enableCaveCulling = new ConfigEntry.Builder() - .set(true) - .comment("" - + "If enabled caves will be culled \n" - + "\n" - + "NOTE: This feature is under development and \n" - + " it is VERY experimental! Please don't report \n" - + " any issues related to this feature. \n" - + "\n" - + "Additional Info: Currently this cull all faces \n" - + " with skylight value of 0 in dimensions that \n" - + " does not have a ceiling.") - .build(); - - public static ConfigEntry caveCullingHeight = new ConfigEntry.Builder() - .setMinDefaultMax(-4096,40,4096) - .comment("At what Y value should cave culling start?") - .build(); - - public static ConfigEntry earthCurveRatio = new ConfigEntry.Builder() - .setMinDefaultMax(0,0,5000) - .comment("" - + "This is the earth size ratio when applying the curvature shader effect. \n" - + "\n" - + "NOTE: This feature is just for fun and is VERY experimental! \n" - + "Please don't report any issues related to this feature. \n" - + "\n" - + " 0 = flat/disabled \n" - + " 1 = 1 to 1 (6,371,000 blocks) \n" - + " 100 = 1 to 100 (63,710 blocks) \n" - + " 10000 = 1 to 10000 (637.1 blocks) \n" - + "\n" - + "NOTE: Due to current limitations, the min value is 50 \n" - + " and the max value is 5000. Any values outside this range \n" - + " will be set to 0(disabled).") - .build(); - - public static ConfigEntry lodBias = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats) - .setMinDefaultMax(0d, 0d, null) - .comment("" - + "What the value of vanilla's LodBias should be \n" - + "If set to 0 the mod wont overwrite vanilla's default (which so happens to also be 0)") - .build(); - - - - - public static ConfigCategory noiseSettings = new ConfigCategory.Builder().set(NoiseSettings.class).build(); - - - public static class NoiseSettings - { - public static ConfigEntry noiseEnable = new ConfigEntry.Builder() - .set(true) - .comment("If noise on the lod's should be enabled") - .build(); - - public static ConfigEntry noiseSteps = new ConfigEntry.Builder() - .setMinDefaultMax(0, 4, null) - .comment("How many steps of noise should be on each block") - .build(); - - public static ConfigEntry noiseIntensity = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats) - .setMinDefaultMax(0d, 10d, 100d) // TODO: Once this becomes a float make it 0-1 instead of 0-100 (I did this cus doubles only allow 2 decimal places) - .comment("How intense the noise should be") - .build(); - - public static ConfigEntry noiseDropoff = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats) - .setMinDefaultMax(0d, 3d, null) - .comment("" - + "How fast the noise should drop off to no noise based upon your lod render distance \n" - + "Eg, if you set it to 3, then the noise effect would completely go away after 1/3 of your render distance") - .build(); - } - } - } - - - public static class WorldGenerator - { - public static ConfigEntry enableDistantGeneration = new ConfigEntry.Builder() - .set(true) - .comment("" - + "Whether to enable Distant chunks generator? \n" - + "\n" - + "Turning this on allows Distant Horizons to make lods for chunks \n" - + " that are outside of vanilla view distance. \n" - + "\n" - + "Note that in server, distant generation is always off.") - .build(); - - public static ConfigEntry distantGeneratorMode = new ConfigEntry.Builder() - .set(EDhApiDistantGeneratorMode.FEATURES) - .comment("" - + "How detailed should fake chunks be generated outside the vanilla render distance? \n" - + "\n" - + "The times are the amount of time it took one of the developer's PC to generate \n" - + " one chunk in Minecraft 1.16.5 and may be inaccurate for different Minecraft versions. \n" - + "They are included to give a rough estimate as to how the different options \n" - + " may perform in comparison to each other. \n" - + "(Note that all modes will load in pre-existing chunks) \n" - + "\n" - + EDhApiDistantGeneratorMode.PRE_EXISTING_ONLY + " \n" - + "Only create LOD data for already generated chunks. \n" - + "\n" - + EDhApiDistantGeneratorMode.BIOME_ONLY + " \n" - + "Only generate the biomes and use the biome's \n" - + " grass color, water color, or snow color. \n" - + "Doesn't generate height, everything is shown at sea level. \n" - + " - Fastest (2-5 ms) \n" - + "\n" - + EDhApiDistantGeneratorMode.BIOME_ONLY_SIMULATE_HEIGHT + " \n" - + "Same as " + EDhApiDistantGeneratorMode.BIOME_ONLY + ", except instead \n" - + " of always using sea level as the LOD height \n" - + " different biome types (mountain, ocean, forest, etc.) \n" - + " use predetermined heights to simulate having height data. \n" - + " - Fastest (2-5 ms) \n" - + "\n" - + EDhApiDistantGeneratorMode.SURFACE + " \n" - + "Generate the world surface, \n" - + " this does NOT include trees, \n" - + " or structures. \n" - + " - Faster (10-20 ms) \n" - + "\n" - + EDhApiDistantGeneratorMode.FEATURES + " \n" - + "Generate everything except structures. \n" - + "WARNING: This may cause world generation bugs or instability! \n" - + " - Fast (15-20 ms) \n" - + "\n" - + EDhApiDistantGeneratorMode.FULL + " \n" - + "Ask the local server to generate/load each chunk. \n" - + "This will show player made structures, which can \n" - + " be useful if you are adding the mod to a pre-existing world. \n" - + "This is the most compatible, but causes server/simulation lag. \n" - + " - Slow (15-50 ms, with spikes up to 200 ms) \n" - + "\n" - + "The multithreaded options may increase CPU load significantly (while generating) \n" - + " depending on how many world generation threads you have allocated.") - .build(); - - public static ConfigEntry lightGenerationMode = new ConfigEntry.Builder() - .set(ELightGenerationMode.FANCY) - .comment("" - + "How should block and sky lights be processed for distant generation? \n" - + "\n" - + "Note that this include already existing chunks since vanilla \n" - + " does not store sky light values to save file. \n" - + "\n" - + ELightGenerationMode.FAST + ": Use height map to fake the light values. \n" - + ELightGenerationMode.FANCY + ": Use actaul light engines to generate proper values. \n" - + "\n" - + "This will effect generation speed, but not the rendering performance.") - .build(); - - public static ConfigEntry generationPriority = new ConfigEntry.Builder() - .set(EGenerationPriority.NEAR_FIRST) - .comment("" - + "In what priority should fake chunks be generated outside the vanilla render distance? \n" - + "\n" - + EGenerationPriority.FAR_FIRST + " \n" - + "Fake chunks are generated from lowest to highest detail \n" - + " with a priority for far away regions. \n" - + "This fills in the world fastest, but you will have large low detail \n" - + " blocks for a while while the generation happens. \n" - + "\n" - + EGenerationPriority.NEAR_FIRST + " \n" - + "Fake chunks are generated around the player \n" - + " in a spiral, similar to vanilla minecraft. \n" - + "Best used when on a server since we can't generate \n" - + " fake chunks. \n" - + "\n" - + EGenerationPriority.BALANCED + " \n" - + "A mix between "+ EGenerationPriority.NEAR_FIRST+"and"+ EGenerationPriority.FAR_FIRST+". \n" - + "First prioritise completing nearby highest detail chunks, \n" - + " then focus on filling in the low detail areas away from the player. \n" - + "\n" - + EGenerationPriority.AUTO + " \n" - + "Uses " + EGenerationPriority.BALANCED + " when on a single player world \n" - + " and " + EGenerationPriority.NEAR_FIRST + " when connected to a server.") - .setPerformance(ConfigEntryPerformance.NONE) - .build(); - - public static ConfigEntry blocksToAvoid = new ConfigEntry.Builder() - .set(EBlocksToAvoid.BOTH) - .comment("" - + "When generating fake chunks, what blocks should be ignored? \n" - + "Ignored blocks don't affect the height of the fake chunk, but might affect the color. \n" - + "So using " + EBlocksToAvoid.BOTH + " will prevent snow covered blocks from appearing one block too tall, \n" - + " but will still show the snow's color.\n" - + "\n" - + EBlocksToAvoid.NONE + ": Use all blocks when generating fake chunks \n" - + EBlocksToAvoid.NON_FULL + ": Only use full blocks when generating fake chunks (ignores slabs, lanterns, torches, tall grass, etc.) \n" - + EBlocksToAvoid.NO_COLLISION + ": Only use solid blocks when generating fake chunks (ignores tall grass, torches, etc.) \n" - + EBlocksToAvoid.BOTH + ": Only use full solid blocks when generating fake chunks") - .setPerformance(ConfigEntryPerformance.NONE) - .build(); - - public static ConfigEntry tintWithAvoidedBlocks = new ConfigEntry.Builder() - .set(true) - .comment("" - + "Should the blocks underneath avoided blocks gain the color of the avoided block? \n" - + " True: a red flower on grass will tint the grass below it red" - + " False: skipped blocks will not change color of surface below them") - .build(); - } - - - public static class Multiplayer - { - public static ConfigEntry serverFolderNameMode = new ConfigEntry.Builder() - .set(EServerFolderNameMode.AUTO) - .comment("" - + " What multiplayer save folders should be named. \n" - + "\n" - + " " + EServerFolderNameMode.AUTO + ": Defaults to " + EServerFolderNameMode.NAME_ONLY + " for both standard multiplayer and LAN. \n" - + " " + EServerFolderNameMode.NAME_ONLY + ": Example: \"Minecraft Server\" \n" - + " " + EServerFolderNameMode.NAME_IP + ": Example: \"Minecraft Server IP 192.168.1.40\" \n" - + " " + EServerFolderNameMode.NAME_IP_PORT + ": Example: \"Minecraft Server IP 192.168.1.40:25565\"" - + " " + EServerFolderNameMode.NAME_IP_PORT_MC_VERSION + ": Example: \"Minecraft Server IP 192.168.1.40:25565 GameVersion 1.16.5\"") - .build(); - - public static ConfigEntry multiDimensionRequiredSimilarity = new ConfigEntry.Builder() - .setMinDefaultMax(0.0, 0.0, 1.0) - .comment("" - + "When matching worlds of the same dimension type the \n" - + " tested chunks must be at least this percent the same \n" - + " in order to be considered the same world. \n" - + "\n" - + "Note: If you use portals to enter a dimension at two \n" - + " different locations this system may think it is two different worlds. \n" - + "\n" - + " 1.0 (100%) the chunks must be identical. \n" - + " 0.5 (50%) the chunks must be half the same. \n" - + " 0.0 (0%) disables multi-dimension support, \n" - + " only one world will be used per dimension.") - .build(); - - } - - - public static class Advanced - { - public static ConfigCategory threading = new ConfigCategory.Builder().set(Threading.class).build(); - - public static ConfigCategory debugging = new ConfigCategory.Builder().set(Debugging.class).build(); - - public static ConfigCategory buffers = new ConfigCategory.Builder().set(Buffers.class).build(); - - public static ConfigEntry lodOnlyMode = new ConfigEntry.Builder() - .set(false) - .comment("" - + " Due to some demand for playing without vanilla terrain, \n" - + " we decided to add this mode for fun. \n" - + "\n" - + " NOTE: Do not report any issues when this mode is on! \n" - + " This setting is only for fun, and mod \n" - + " compatibility is not guaranteed.") - .build(); - - - public static class Threading - { - public static final String THREAD_NOTE = "" - + " Note: \n" - + " If the total thread count in this config is more threads than your CPU has cores, \n" - + " CPU performance may suffer if Distant Horizons has a lot to load or generate. \n" - + " This can be an issue when first loading into a world, when flying, and/or when generating new terrain."; + // TODO modify debugging.rendererMode + public static ConfigEntry quickEnableRendering = new ConfigEntry.Builder() + .set(true) + .comment("" + + "If true, Distant Horizons will render LODs beyond the vanilla render distance." + + "") + .setAppearance(ConfigEntryAppearance.ONLY_IN_GUI) // TODO set when the game boots + //.addListener(null) // TODO add listener + .build(); + + public static ConfigLinkedEntry quickLodChunkRenderDistance = new ConfigLinkedEntry(Advanced.Graphics.Quality.lodChunkRenderDistance); + + public static ConfigEntry quickQualitySetting = new ConfigEntry.Builder() + .set(EQuickQuality.MEDIUM) + .comment("" + + "Changing this setting will modify a number of different settings that will change the \n" + + "visual fidelity of the rendered LODs.\n" + + "\n" + + "Higher settings will improve the graphical quality while increasing GPU and memory use.\n" + + "") + .setAppearance(ConfigEntryAppearance.ONLY_IN_GUI) // TODO set when the game boots + //.addListener(null) // TODO add listener + .build(); + + public static ConfigEntry quickThreadSetting = new ConfigEntry.Builder() + .set(EQuickThread.BALANCED) + .comment("" + + "Changing this setting will modify a number of different settings that will change \n" + + "the load that Distant Horizons is allowed to put on your CPU. \n" + + "\n" + + "Higher options will improve LOD generation and loading speed, \n" + + "but will increase CPU load and may introduce stuttering.\n" + + "") + .setAppearance(ConfigEntryAppearance.ONLY_IN_GUI) // TODO set when the game boots + //.addListener(null) // TODO add listener + .build(); + + public static ConfigLinkedEntry quickEnableWorldGenerator = new ConfigLinkedEntry(Advanced.WorldGenerator.enableDistantGeneration); + + public static ConfigEntry optionsButton = new ConfigEntry.Builder() + .set(true) + .comment("" + + "Should Distant Horizon's config button appear in the options screen next to fov slider?") + .build(); + + + + public static ConfigCategory advanced = new ConfigCategory.Builder().set(Advanced.class).build(); + + public static class Advanced + { + public static ConfigUIComment advancedConfigScreenNote = new ConfigUIComment(); + + public static ConfigCategory graphics = new ConfigCategory.Builder().set(Graphics.class).build(); + public static ConfigCategory worldGenerator = new ConfigCategory.Builder().set(WorldGenerator.class).build(); + public static ConfigCategory multiplayer = new ConfigCategory.Builder().set(Multiplayer.class).build(); + public static ConfigCategory threading = new ConfigCategory.Builder().set(MultiThreading.class).build(); + public static ConfigCategory buffers = new ConfigCategory.Builder().set(GpuBuffers.class).build(); + public static ConfigCategory autoUpdater = new ConfigCategory.Builder().set(AutoUpdater.class).build(); + + public static ConfigCategory logging = new ConfigCategory.Builder().set(Logging.class).build(); + public static ConfigCategory debugging = new ConfigCategory.Builder().set(Debugging.class).build(); + + + public static class Graphics + { + public static ConfigCategory quality = new ConfigCategory.Builder().set(Quality.class).build(); + public static ConfigCategory fog = new ConfigCategory.Builder().set(Fog.class).build(); + public static ConfigCategory noiseTextureSettings = new ConfigCategory.Builder().set(NoiseTextureSettings.class).build(); + public static ConfigCategory advancedGraphics = new ConfigCategory.Builder().set(AdvancedGraphics.class).build(); - public static final ConfigEntry numberOfWorldGenerationThreads = new ConfigEntry.Builder() - .setMinDefaultMax(1, - Runtime.getRuntime().availableProcessors()/6, - Runtime.getRuntime().availableProcessors()) - .comment("" - + " How many threads should be used when generating LOD \n" - + " chunks outside the normal render distance? \n" - + "\n" - + " If you experience stuttering when generating distant LODs, \n" - + " decrease this number. \n" - + " If you want to increase LOD \n" - + " generation speed, increase this number. \n" - + "\n" - + THREAD_NOTE) - .build(); - - public static ConfigEntry numberOfBufferBuilderThreads = new ConfigEntry.Builder() - .setMinDefaultMax(1, - Runtime.getRuntime().availableProcessors()/4, - Runtime.getRuntime().availableProcessors()) - .comment("" - + "How many threads are used when building geometry data? \n" - + "\n" - + " If you experience high CPU usage when NOT generating distant \n" - + " fake chunks, lower this number. A higher number will make fake\n" - + " fake chunks' transition faster when moving around the world. \n" - + "\n" + public static class Quality + { + public static ConfigEntry drawResolution = new ConfigEntry.Builder() + .set(EHorizontalResolution.BLOCK) + .comment("" + + "What is the maximum detail LODs should be drawn at? \n" + + "Higher settings will increase memory and GPU usage. \n" + + "\n" + + EHorizontalResolution.CHUNK + ": render 1 LOD for each Chunk. \n" + + EHorizontalResolution.HALF_CHUNK + ": render 4 LODs for each Chunk. \n" + + EHorizontalResolution.FOUR_BLOCKS + ": render 16 LODs for each Chunk. \n" + + EHorizontalResolution.TWO_BLOCKS + ": render 64 LODs for each Chunk. \n" + + EHorizontalResolution.BLOCK + ": render 256 LODs for each Chunk (width of one block). \n" + + "\n" + + "Lowest Quality: " + EHorizontalResolution.CHUNK + "\n" + + "Highest Quality: " + EHorizontalResolution.BLOCK) + .addListener(RenderCacheConfigEventHandler.INSTANCE) + .setPerformance(ConfigEntryPerformance.MEDIUM) + .build(); + + public static ConfigEntry lodChunkRenderDistance = new ConfigEntry.Builder() + .setMinDefaultMax(32, 128, 4096) + .comment("The radius of the mod's render distance. (measured in chunks)") + .setPerformance(ConfigEntryPerformance.HIGH) + .build(); + + public static ConfigEntry verticalQuality = new ConfigEntry.Builder() + .set(EVerticalQuality.MEDIUM) + .comment("" + + "This indicates how well LODs will represent \n" + + "overhangs, caves, floating islands, etc. \n" + + "Higher options will make the world more accurate, but" + + "will increase memory and GPU usage. \n" + + "\n" + + "Lowest Quality: " + EVerticalQuality.HEIGHT_MAP + "\n" + + "Highest Quality: " + EVerticalQuality.ULTRA) + .setPerformance(ConfigEntryPerformance.VERY_HIGH) + .addListener(RenderCacheConfigEventHandler.INSTANCE) + .build(); + + // TODO merge with horizontal quality + public static ConfigEntry horizontalScale = new ConfigEntry.Builder() + .setMinDefaultMax(2, 12, 64) + .comment("" + + "This indicates how quickly fake chunks decrease in quality the further away they are. \n" + + "Higher settings will render higher quality fake chunks farther away, \n" + + " but will increase memory and GPU usage.") + .build(); + + public static ConfigEntry horizontalQuality = new ConfigEntry.Builder() + .set(EHorizontalQuality.MEDIUM) + .comment("" + + "This indicates how quickly LODs decrease in quality the further away they are. \n" + + "Higher settings will render higher quality fake chunks farther away, \n" + + "but will increase memory and GPU usage.") + .setPerformance(ConfigEntryPerformance.MEDIUM) + .build(); + + public static ConfigEntry transparency = new ConfigEntry.Builder() + .set(ETransparency.COMPLETE) + .comment("" + + "How should LOD transparency be handled. \n" + + "\n" + + ETransparency.COMPLETE + ": LODs will render transparent. \n" + + ETransparency.FAKE + ": LODs will be opaque, but shaded to match the blocks underneath. \n" + + ETransparency.DISABLED + ": LODs will be opaque. \n" + + "") + .setPerformance(ConfigEntryPerformance.MEDIUM) + .build(); + + // TODO fixme +// public static ConfigEntry lodBiomeBlending = new ConfigEntry.Builder() +// .setMinDefaultMax(0,1,7) +// .comment("" +// + "This is the same as vanilla Biome Blending settings for Lod area. \n" +// + " Note that anything other than '0' will greatly effect Lod building time \n" +// + " and increase triangle count. The cost on chunk generation speed is also \n" +// + " quite large if set too high.\n" +// + "\n" +// + " '0' equals to Vanilla Biome Blending of '1x1' or 'OFF', \n" +// + " '1' equals to Vanilla Biome Blending of '3x3', \n" +// + " '2' equals to Vanilla Biome Blending of '5x5'...") +// .build(); + } + + public static class Fog + { + public static ConfigEntry fogDistance = new ConfigEntry.Builder() + .set(EFogDistance.FAR) + .comment("At what distance should Fog be drawn on the LODs?") + .setPerformance(ConfigEntryPerformance.NONE) + .build(); + + public static ConfigEntry fogDrawMode = new ConfigEntry.Builder() + .set(EFogDrawMode.FOG_ENABLED) + .comment("" + + "When should fog be drawn? \n" + + "\n" + + EFogDrawMode.USE_OPTIFINE_SETTING + ": Use whatever Fog setting Optifine is using.\n" + + "If Optifine isn't installed this defaults to " + EFogDrawMode.FOG_ENABLED + ". \n" + + EFogDrawMode.FOG_ENABLED + ": Never draw fog on the LODs \n" + + EFogDrawMode.FOG_DISABLED + ": Always draw fast fog on the LODs \n" + + "\n" + + "Disabling fog will improve GPU performance.") + .setPerformance(ConfigEntryPerformance.VERY_LOW) + .build(); + + public static ConfigEntry fogColorMode = new ConfigEntry.Builder() + .set(EFogColorMode.USE_WORLD_FOG_COLOR) + .comment("" + + "What color should fog use? \n" + + "\n" + + EFogColorMode.USE_WORLD_FOG_COLOR + ": Use the world's fog color. \n" + + EFogColorMode.USE_SKY_COLOR + ": Use the sky's color.") + .setPerformance(ConfigEntryPerformance.NONE) + .build(); + + public static ConfigEntry disableVanillaFog = new ConfigEntry.Builder() + .set(true) + .comment("" + + "Should Minecraft's fog be disabled? \n" + + "\n" + + "Note: Other mods may conflict with this setting.") + .build(); + + + + public static ConfigCategory advancedFog = new ConfigCategory.Builder().set(AdvancedFog.class).build(); + + + public static class AdvancedFog + { + private static final Double FOG_RANGE_MIN = 0.0; + private static final Double FOG_RANGE_MAX = Math.sqrt(2.0); + + public static ConfigEntry farFogStart = new ConfigEntry.Builder() + .setMinDefaultMax(FOG_RANGE_MIN, 0.0, FOG_RANGE_MAX) + .comment("" + + "At what distance should the far fog start? \n" + + "\n" + + "0.0: Fog starts at the player's position. \n" + + "1.0: Fog starts at the closest edge of the vanilla render distance. \n" + + "1.414: Fog starts at the corner of the vanilla render distance.") + .build(); + + public static ConfigEntry farFogEnd = new ConfigEntry.Builder() + .setMinDefaultMax(FOG_RANGE_MIN, 1.0, FOG_RANGE_MAX) + .comment("" + + "Where should the far fog end? \n" + + "\n" + + "0.0: Fog ends at player's position.\n" + + "1.0: Fog ends at the closest edge of the vanilla render distance. \n" + + "1.414: Fog ends at the corner of the vanilla render distance.") + .build(); + + public static ConfigEntry farFogMin = new ConfigEntry.Builder() + .setMinDefaultMax(-5.0,0.0, FOG_RANGE_MAX) + .comment("" + + "What is the minimum fog thickness? \n" + + "\n" + + "0.0: No fog. \n" + + "1.0: Fully opaque fog.") + .build(); + + public static ConfigEntry farFogMax = new ConfigEntry.Builder() + .setMinDefaultMax(FOG_RANGE_MIN, 1.0, 5.0) + .comment("" + + "What is the maximum fog thickness? \n" + + "\n" + + "0.0: No fog. \n" + + "1.0: Fully opaque fog.") + .build(); + + public static ConfigEntry farFogFalloff = new ConfigEntry.Builder() + .set(EFogFalloff.EXPONENTIAL_SQUARED) + .comment("" + + "How should the fog thickness should be calculated? \n" + + "\n" + + EFogFalloff.LINEAR + ": Linear based on distance (will ignore 'density')\n" + + EFogFalloff.EXPONENTIAL + ": 1/(e^(distance*density)) \n" + + EFogFalloff.EXPONENTIAL_SQUARED + ": 1/(e^((distance*density)^2)") + .build(); + + public static ConfigEntry farFogDensity = new ConfigEntry.Builder() + .setMinDefaultMax(0.01,2.5, 50.0) + .comment("" + + "Used in conjunction with the Fog Falloff.") + .build(); + + + + public static ConfigCategory heightFog = new ConfigCategory.Builder().set(HeightFog.class).build(); + + + public static class HeightFog + { + public static ConfigUIComment heightFogConfigScreenNote = new ConfigUIComment(); + + public static ConfigEntry heightFogMixMode = new ConfigEntry.Builder() + .set(EHeightFogMixMode.BASIC) + .comment("" + + "How should height effect the fog thickness? \n" + + "Note: height fog is combined with the other fog settings. \n" + + "\n" + + EHeightFogMixMode.BASIC + ": No special height fog effect. Fog is calculated based on camera distance \n" + + EHeightFogMixMode.IGNORE_HEIGHT + ": Ignore height completely. Fog is only calculated with horizontal distance \n" + + EHeightFogMixMode.ADDITION + ": heightFog + farFog \n" + + EHeightFogMixMode.MAX + ": max(heightFog, farFog) \n" + + EHeightFogMixMode.MULTIPLY + ": heightFog * farFog \n" + + EHeightFogMixMode.INVERSE_MULTIPLY + ": 1 - (1-heightFog) * (1-farFog) \n" + + EHeightFogMixMode.LIMITED_ADDITION + ": farFog + max(farFog, heightFog) \n" + + EHeightFogMixMode.MULTIPLY_ADDITION + ": farFog + farFog * heightFog \n" + + EHeightFogMixMode.INVERSE_MULTIPLY_ADDITION + ": farFog + 1 - (1-heightFog) * (1-farFog) \n" + + EHeightFogMixMode.AVERAGE + ": farFog*0.5 + heightFog*0.5 \n" + + "\n" + + "Note: height fog settings are ignored if '"+EHeightFogMixMode.BASIC+"' or '"+EHeightFogMixMode.IGNORE_HEIGHT+"' are selected.") + .build(); + + public static ConfigEntry heightFogMode = new ConfigEntry.Builder() + .set(EHeightFogMode.ABOVE_AND_BELOW_CAMERA) + .comment("" + + "Where should the height fog start? \n" + + "\n" + + EHeightFogMode.ABOVE_CAMERA + ": Height fog starts at the camera and goes towards the sky \n" + + EHeightFogMode.BELOW_CAMERA + ": Height fog starts at the camera and goes towards the void \n" + + EHeightFogMode.ABOVE_AND_BELOW_CAMERA + ": Height fog starts from the camera to goes towards both the sky and void \n" + + EHeightFogMode.ABOVE_SET_HEIGHT + ": Height fog starts from a set height and goes towards the sky \n" + + EHeightFogMode.BELOW_SET_HEIGHT + ": Height fog starts from a set height and goes towards the void \n" + + EHeightFogMode.ABOVE_AND_BELOW_SET_HEIGHT + ": Height fog starts from a set height and goes towards both the sky and void") + .build(); + + public static ConfigEntry heightFogHeight = new ConfigEntry.Builder() + .setMinDefaultMax(-4096.0, 70.0, 4096.0) + .comment("If the height fog is calculated around a set height, what is that height position?") + .build(); + + public static ConfigEntry heightFogStart = new ConfigEntry.Builder() + .setMinDefaultMax(FOG_RANGE_MIN, 0.0, FOG_RANGE_MAX) + .comment("" + + "Should the start of the height fog be offset? \n" + + "\n" + + "0.0: Fog start with no offset.\n" + + "1.0: Fog start with offset of the entire world's height. (Includes depth)") + .build(); + + public static ConfigEntry heightFogEnd = new ConfigEntry.Builder() + .setMinDefaultMax(FOG_RANGE_MIN, 1.0, FOG_RANGE_MAX) + .comment("" + + "Should the end of the height fog be offset? \n" + + "\n" + + "0.0: Fog end with no offset.\n" + + "1.0: Fog end with offset of the entire world's height. (Include depth)") + .build(); + + public static ConfigEntry heightFogMin = new ConfigEntry.Builder() + .setMinDefaultMax(-5.0, 0.0, FOG_RANGE_MAX) + .comment("" + + "What is the minimum fog thickness? \n" + + "\n" + + "0.0: No fog. \n" + + "1.0: Fully opaque fog.") + .build(); + + public static ConfigEntry heightFogMax = new ConfigEntry.Builder() + .setMinDefaultMax(FOG_RANGE_MIN, 1.0, 5.0) + .comment("" + + "What is the maximum fog thickness? \n" + + "\n" + + "0.0: No fog. \n" + + "1.0: Fully opaque fog.") + .build(); + + public static ConfigEntry heightFogFalloff = new ConfigEntry.Builder() + .set(EFogFalloff.EXPONENTIAL_SQUARED) + .comment("" + + "How should the height fog thickness should be calculated? \n" + + "\n" + + EFogFalloff.LINEAR + ": Linear based on height (will ignore 'density')\n" + + EFogFalloff.EXPONENTIAL + ": 1/(e^(height*density)) \n" + + EFogFalloff.EXPONENTIAL_SQUARED + ": 1/(e^((height*density)^2)") + .build(); + + public static ConfigEntry heightFogDensity = new ConfigEntry.Builder() + .setMinDefaultMax(0.01, 2.5, 50.0) + .comment("What is the height fog's density?") + .build(); + + } + } + } + + public static class NoiseTextureSettings + { + public static ConfigEntry noiseEnable = new ConfigEntry.Builder() + .set(true) + .comment("" + + "Should a noise texture be applied to LODs? \n" + +"\n" + + "This is done to simulate textures and make the LODs appear more detailed. \n" + + "") + .build(); + + public static ConfigEntry noiseSteps = new ConfigEntry.Builder() + .setMinDefaultMax(0, 4, null) + .comment("" + + "How many steps of noise should be applied to LODs?") + .build(); + + public static ConfigEntry noiseIntensity = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesn't support floats) + .setMinDefaultMax(0d, 10d, 100d) // TODO: Once this becomes a float make it 0-1 instead of 0-100 (I did this cus doubles only allow 2 decimal places) + .comment("" + + "How intense should the noise should be?") + .build(); + + public static ConfigEntry noiseDropoff = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesn't support floats) + .setMinDefaultMax(0d, 3d, null) + .comment("" + + "How far should the noise texture render before it fades away? \n" + + "\n" + + "0.0 - the noise texture will render the entire LOD render distance. \n" + + "3.0 - the noise texture will fade away at 1/3 of the LOD render distance. \n" + + "") + .build(); + } + + public static class AdvancedGraphics + { + // TODO re-implement +// public static ConfigEntry disableDirectionalCulling = new ConfigEntry.Builder() +// .set(false) +// .comment("" +// + "If false fake chunks behind the player's camera \n" +// + "aren't drawn, increasing GPU performance. \n" +// + "\n" +// + "If true all LODs are drawn, even those behind \n" +// + "the player's camera, decreasing GPU performance. \n" +// + "\n" +// + "Disable this if you see LODs disappearing at the corners of your vision.") +// .build(); + + // TODO replace with better options + public static ConfigEntry useExtendedNearClipPlane = new ConfigEntry.Builder() + .set(true) + .comment("" + + "Will prevent some overdraw issues, but may cause nearby fake chunks to render incorrectly \n" + + " especially when in/near an ocean.") + .setPerformance(ConfigEntryPerformance.NONE) + .build(); + + public static ConfigEntry brightnessMultiplier = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats) + .set(1.0) + .comment("" + + "How bright LOD colors are. \n" + + "\n" + + "0 = black \n" + + "1 = normal \n" + + "2 = near white") + .build(); + + public static ConfigEntry saturationMultiplier = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats) + .set(1.0) + .comment("" + + "How saturated LOD colors are. \n" + + "\n" + + "0 = black and white \n" + + "1 = normal \n" + + "2 = very saturated") + .build(); + + // TODO replace with better options + public static ConfigEntry enableCaveCulling = new ConfigEntry.Builder() + .set(true) + .comment("" + + "If enabled caves will be culled \n" + + "\n" + + "NOTE: This feature is under development and \n" + + " it is VERY experimental! Please don't report \n" + + " any issues related to this feature. \n" + + "\n" + + "Additional Info: Currently this cull all faces \n" + + " with skylight value of 0 in dimensions that \n" + + " does not have a ceiling.") + .build(); + + public static ConfigEntry caveCullingHeight = new ConfigEntry.Builder() + .setMinDefaultMax(-4096,40,4096) + .comment("" + + "At what Y value should cave culling start?") + .build(); + + public static ConfigEntry earthCurveRatio = new ConfigEntry.Builder() + .setMinDefaultMax(0,0,5000) + .comment("" + + "This is the earth size ratio when applying the curvature shader effect. \n" + + "Note: Enabling this feature may cause rendering bugs. \n" + + "\n" + + "0 = flat/disabled \n" + + "1 = 1 to 1 (6,371,000 blocks) \n" + + "100 = 1 to 100 (63,710 blocks) \n" + + "10000 = 1 to 10000 (637.1 blocks) \n" + + "\n" + + "Note: Due to current limitations, the min value is 50 \n" + + "and the max value is 5000. Any values outside this range \n" + + "will be set to 0 (disabled).") + .build(); + + public static ConfigEntry lodBias = new ConfigEntry.Builder() + .setMinDefaultMax(0d, 0d, null) + .comment("" + + "What the value should vanilla Minecraft's texture LodBias be? \n" + + "If set to 0 the mod wont overwrite vanilla's default (which so happens to also be 0)") + .build(); + + } + + } + + public static class WorldGenerator + { + public static ConfigEntry enableDistantGeneration = new ConfigEntry.Builder() + .set(true) + .comment("" + + " Should Distant Horizons slowly generate LODs \n" + + " outside the vanilla render distance?\n" + + "\n" + + " Note: when on a server, distant generation isn't supported \n" + + " and will always be disabled.") + .build(); + + public static ConfigEntry distantGeneratorMode = new ConfigEntry.Builder() + .set(EDhApiDistantGeneratorMode.FEATURES) + .comment("" + + "How detailed should LODs be generated outside the vanilla render distance? \n" + + "\n" + + EDhApiDistantGeneratorMode.PRE_EXISTING_ONLY + " \n" + + "Only create LOD data for already generated chunks. \n" + + "\n" + + EDhApiDistantGeneratorMode.BIOME_ONLY + " \n" + + "Only generate the biomes and use the biome's \n" + + "grass color, water color, or snow color. \n" + + "Doesn't generate height, everything is shown at sea level. \n" + + "- Fastest \n" + + "\n" + + EDhApiDistantGeneratorMode.BIOME_ONLY_SIMULATE_HEIGHT + " \n" + + "Same as " + EDhApiDistantGeneratorMode.BIOME_ONLY + ", except instead \n" + + "of always using sea level as the LOD height \n" + + "different biome types (mountain, ocean, forest, etc.) \n" + + "use predetermined heights to simulate having height data. \n" + + "- Fastest \n" + + "\n" + + EDhApiDistantGeneratorMode.SURFACE + " \n" + + "Generate the world surface, \n" + + "this does NOT include trees, \n" + + "or structures. \n" + + "- Faster \n" + + "\n" + + EDhApiDistantGeneratorMode.FEATURES + " \n" + + "Generate everything except structures. \n" + + "WARNING: This may cause world generator bugs or instability when paired with certain world generator mods. \n" + + "- Fast \n" + + "") + /* + // FULL isn't currently implemented + + "\n" + + EDhApiDistantGeneratorMode.FULL + " \n" + + "Ask the local server to generate/load each chunk. \n" + + "This is the most compatible, but will cause server/simulation lag. \n" + + "- Slow (15-50 ms, with spikes up to 200 ms) \n" + */ + .build(); + + public static ConfigEntry lightingEngine = new ConfigEntry.Builder() + .set(ELightGenerationMode.DISTANT_HORIZONS) + .comment("" + + " How should distant generation chunk lighting be generated? \n" + + "\n" + + ELightGenerationMode.DISTANT_HORIZONS + ": Uses Distant Horizons' lighting engine to estimate chunk lighting. \n" + + " Generally lower quality; but more stable for large numbers of world generator threads. \n" + + ELightGenerationMode.MINECRAFT + ": Use Minecraft's lighting engine to generate chunk lighting. \n" + + " Generally higher quality; but may crash MC's lighting engine if there is an issue. \n" + + "\n" + + "This will effect generation speed, but not the rendering performance.") + .build(); + + // deprecated and not implemented, can be made public if we ever re-implement it + @Deprecated + private static ConfigEntry generationPriority = new ConfigEntry.Builder() + .set(EGenerationPriority.NEAR_FIRST) + .comment("" + + "In what priority should fake chunks be generated outside the vanilla render distance? \n" + + "\n" + + EGenerationPriority.FAR_FIRST + " \n" + + "Fake chunks are generated from lowest to highest detail \n" + + " with a priority for far away regions. \n" + + "This fills in the world fastest, but you will have large low detail \n" + + " blocks for a while while the generation happens. \n" + + "\n" + + EGenerationPriority.NEAR_FIRST + " \n" + + "Fake chunks are generated around the player \n" + + " in a spiral, similar to vanilla minecraft. \n" + + "Best used when on a server since we can't generate \n" + + " fake chunks. \n" + + "\n" + + EGenerationPriority.BALANCED + " \n" + + "A mix between "+ EGenerationPriority.NEAR_FIRST+"and"+ EGenerationPriority.FAR_FIRST+". \n" + + "First prioritise completing nearby highest detail chunks, \n" + + " then focus on filling in the low detail areas away from the player. \n" + + "\n" + + EGenerationPriority.AUTO + " \n" + + "Uses " + EGenerationPriority.BALANCED + " when on a single player world \n" + + " and " + EGenerationPriority.NEAR_FIRST + " when connected to a server.") + .setPerformance(ConfigEntryPerformance.NONE) + .build(); + + // TODO fixme + public static ConfigEntry blocksToAvoid = new ConfigEntry.Builder() + .set(EBlocksToAvoid.BOTH) + .comment("" + + "When generating fake chunks, what blocks should be ignored? \n" + + "Ignored blocks don't affect the height of the fake chunk, but might affect the color. \n" + + "So using " + EBlocksToAvoid.BOTH + " will prevent snow covered blocks from appearing one block too tall, \n" + + " but will still show the snow's color.\n" + + "\n" + + EBlocksToAvoid.NONE + ": Use all blocks when generating fake chunks \n" + + EBlocksToAvoid.NON_FULL + ": Only use full blocks when generating fake chunks (ignores slabs, lanterns, torches, tall grass, etc.) \n" + + EBlocksToAvoid.NO_COLLISION + ": Only use solid blocks when generating fake chunks (ignores tall grass, torches, etc.) \n" + + EBlocksToAvoid.BOTH + ": Only use full solid blocks when generating fake chunks") + .setPerformance(ConfigEntryPerformance.NONE) + .build(); + + // TODO fixme + public static ConfigEntry tintWithAvoidedBlocks = new ConfigEntry.Builder() + .set(true) + .comment("" + + "Should the blocks underneath avoided blocks gain the color of the avoided block? \n" + + " True: a red flower on grass will tint the grass below it red" + + " False: skipped blocks will not change color of surface below them") + .build(); + } + + public static class Multiplayer + { + public static ConfigEntry serverFolderNameMode = new ConfigEntry.Builder() + .set(EServerFolderNameMode.NAME_ONLY) + .comment("" + + "How should multiplayer save folders should be named? \n" + + "\n" + + EServerFolderNameMode.NAME_ONLY + ": Example: \"Minecraft Server\" \n" + + EServerFolderNameMode.NAME_IP + ": Example: \"Minecraft Server IP 192.168.1.40\" \n" + + EServerFolderNameMode.NAME_IP_PORT + ": Example: \"Minecraft Server IP 192.168.1.40:25565\"" + + EServerFolderNameMode.NAME_IP_PORT_MC_VERSION + ": Example: \"Minecraft Server IP 192.168.1.40:25565 GameVersion 1.16.5\"") + .build(); + + public static ConfigEntry multiDimensionRequiredSimilarity = new ConfigEntry.Builder() + .setMinDefaultMax(0.0, 0.0, 1.0) + .comment("" + + "AKA: Multiverse support. \n" + + "\n" + + "When matching levels (dimensions) of the same type (overworld, nether, etc.) the \n" + + "loaded chunks must be at least this percent the same \n" + + "in order to be considered the same world. \n" + + "\n" + + "Note: If you use portals to enter a dimension at two \n" + + "different locations the system will think the dimension \n" + + "it is two different levels. \n" + + "\n" + + "1.0 (100%) the chunks must be identical. \n" + + "0.5 (50%) the chunks must be half the same. \n" + + "0.0 (0%) disables multi-dimension support, \n" + + " only one world will be used per dimension. \n" + + "\n" + + "If multiverse support is needed start with a value of 0.2 \n" + + "and tweak the sensitivity from there." + + "Lower values mean the matching is less strict.\n" + + "Higher values mean the matching is more strict.\n" + + "") + .build(); + + } + + public static class MultiThreading + { + public static final String THREAD_NOTE = "" + + "Multi-threading Note: \n" + + "If the total thread count in Distant Horizon's config is more threads than your CPU has cores, \n" + + "CPU performance may suffer if Distant Horizons has a lot to load or generate. \n" + + "This can be an issue when first loading into a world, when flying, and/or when generating new terrain."; + + + public static final ConfigEntry numberOfWorldGenerationThreads = new ConfigEntry.Builder() + .setMinDefaultMax(1, + Runtime.getRuntime().availableProcessors()/6, + Runtime.getRuntime().availableProcessors()) + .comment("" + + "How many threads should be used when generating LOD \n" + + "chunks outside the normal render distance? \n" + + "\n" + + "If you experience stuttering when generating distant LODs, \n" + + "decrease this number. \n" + + "If you want to increase LOD \n" + + "generation speed, increase this number. \n" + + "\n" + THREAD_NOTE) - .build(); + .build(); + + public static ConfigEntry numberOfBufferBuilderThreads = new ConfigEntry.Builder() + .setMinDefaultMax(1, + Runtime.getRuntime().availableProcessors()/4, + Runtime.getRuntime().availableProcessors()) + .comment("" + + "How many threads are used when building geometry data for the GPU? \n" + + "\n" + + "If you experience high CPU usage when NOT generating distant \n" + + "LODs, lower this number. A higher number will make \n" + + "LODs' transition faster when moving around the world. \n" + + "\n" + + THREAD_NOTE) + .build(); public static final ConfigEntry numberOfFileHandlerThreads = new ConfigEntry.Builder() .setMinDefaultMax(1, Runtime.getRuntime().availableProcessors()/8, Runtime.getRuntime().availableProcessors()) .comment("" - + " How many threads should be used when reading in LOD data from disk? \n" + + "How many threads should be used when reading in LOD data from disk? \n" + "\n" - + " Increasing this number will cause LODs to load in faster, \n" - + " but may cause stuttering when loading a new world or when \n" - + " quickly flying through existing LODs. \n" + + "Increasing this number will cause LODs to load in faster, \n" + + "but may cause lag when loading a new world or when \n" + + "quickly flying through existing LODs. \n" + "\n" + THREAD_NOTE) .build(); @@ -758,261 +776,279 @@ public class Config Runtime.getRuntime().availableProcessors()/4, Runtime.getRuntime().availableProcessors()) .comment("" - + " How many threads should be used when converting full ID data to render data? \n" + + "How many threads should be used when converting full ID data to render data? \n" + "\n" - + " These threads run both when terrain is generated and when\n" - + " and when certain graphics settings are changed. \n" + + "These threads run both when terrain is generated and when\n" + + "certain graphics settings are changed. \n" + "\n" - + " Generally this number should be equal to the number of world\n" - + " generator threads, although these threads shouldn't run as\n" - + " often (or as long) as the world generator threads.\n" + + "Generally this number should be equal to the number of world\n" + + "generator threads, although these threads shouldn't run as\n" + + "often (or as long) as the world generator threads.\n" + "\n" + THREAD_NOTE) .build(); - } - - - public static class Debugging - { - public static ConfigEntry rendererMode = new ConfigEntry.Builder() - .set(ERendererMode.DEFAULT) - .comment("" - + "What renderer is active? \n" - + "\n" - + ERendererMode.DEFAULT + ": Default lod renderer \n" - + ERendererMode.DEBUG + ": Debug testing renderer \n" - + ERendererMode.DISABLED + ": Disable rendering") - .build(); - - public static ConfigEntry debugMode = new ConfigEntry.Builder() - .set(EDebugMode.OFF) - .comment("" - + "Should specialized colors/rendering modes be used? \n" - + "\n" - + EDebugMode.OFF + ": Fake chunks will be drawn with their normal colors. \n" - + EDebugMode.SHOW_WIREFRAME + ": Fake chunks will be drawn as wireframes. \n" - + EDebugMode.SHOW_DETAIL + ": Fake chunks color will be based on their detail level. \n" - + EDebugMode.SHOW_DETAIL_WIREFRAME + ": Fake chunks color will be based on their detail level, drawn as a wireframe. \n" - + EDebugMode.SHOW_GENMODE + ": Fake chunks color will be based on their distant generation mode. \n" - + EDebugMode.SHOW_GENMODE_WIREFRAME + ": Fake chunks color will be based on their distant generation mode, drawn as a wireframe. \n" - + EDebugMode.SHOW_OVERLAPPING_QUADS + ": Fake chunks will be drawn with total white, but overlapping quads will be drawn with red. \n" - + EDebugMode.SHOW_OVERLAPPING_QUADS_WIREFRAME + ": Fake chunks will be drawn with total white, \n" - + " but overlapping quads will be drawn with red, drawn as a wireframe.") - .build(); - - public static ConfigEntry enableDebugKeybindings = new ConfigEntry.Builder() - .set(false) - .comment("" - + "If true the F8 key can be used to cycle through the different debug modes. \n" - + " and the F6 key can be used to enable and disable LOD rendering.") - .build(); - - public static ConfigCategory debugSwitch = new ConfigCategory.Builder().set(DebugSwitch.class).build(); - - public static ConfigCategory debugConfigScreen = new ConfigCategory.Builder() - .set(DebugConfigScreen.class) - .build(); - - - /** This class is some debug to different features of the config GUI */ - public static class DebugConfigScreen { - // Defined in the lang, just a note about this screen - public static ConfigUIComment debugConfigScreenNote = new ConfigUIComment(); - - public static ConfigEntry boolTest = new ConfigEntry.Builder() - .set(false) - .build(); - - public static ConfigEntry byteTest = new ConfigEntry.Builder() - .set((byte) 8) - .build(); - - public static ConfigEntry intTest = new ConfigEntry.Builder() - .set(69420) - .build(); - - public static ConfigEntry doubleTest = new ConfigEntry.Builder() - .set(420.69d) - .build(); - - public static ConfigEntry shortTest = new ConfigEntry.Builder() - .set((short) 42) - .build(); - - public static ConfigEntry longTest = new ConfigEntry.Builder() - .set(42069L) - .build(); - - public static ConfigEntry floatTest = new ConfigEntry.Builder() - .set(0.42069f) - .build(); - - public static ConfigEntry stringTest = new ConfigEntry.Builder() - .set("Test input box") - .build(); - - public static ConfigEntry> listTest = new ConfigEntry.Builder>() - .set(new ArrayList()) - .build(); - - public static ConfigEntry> mapTest = new ConfigEntry.Builder>() - .set(new HashMap()) - .build(); - - public static ConfigCategory categoryTest = new ConfigCategory.Builder().set(CategoryTest.class).build(); - - public static ConfigEntry linkableTest = new ConfigEntry.Builder() - .set(420) - .build(); - - - public static class CategoryTest { - // The name of this can be anything as it would be overwritten by the name of the linked object - public static ConfigLinkedEntry linkableTest = new ConfigLinkedEntry(DebugConfigScreen.linkableTest); - } - } - - public static class DebugSwitch { - /* The logging switches available: - * WorldGenEvent - * WorldGenPerformance - * WorldGenLoadEvent - * LodBuilderEvent - * RendererBufferEvent - * RendererGLEvent - * FileReadWriteEvent - * FileSubDimEvent - * NetworkEvent //NOT IMPL YET - */ - public static ConfigEntry logWorldGenEvent = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) - .comment("" - + "If enabled, the mod will log information about the world generation process. \n" - + "This can be useful for debugging.") - .build(); - - public static ConfigEntry logWorldGenPerformance = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_FILE) - .comment("" - + "If enabled, the mod will log performance about the world generation process. \n" - + "This can be useful for debugging.") - .build(); - - public static ConfigEntry logWorldGenLoadEvent = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_FILE) - .comment("" - + "If enabled, the mod will log information about the world generation process. \n" - + "This can be useful for debugging.") - .build(); - - public static ConfigEntry logLodBuilderEvent = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) - .comment("" - + "If enabled, the mod will log information about the LOD generation process. \n" - + "This can be useful for debugging.") - .build(); - - public static ConfigEntry logRendererBufferEvent = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) - .comment("" - + "If enabled, the mod will log information about the renderer buffer process. \n" - + "This can be useful for debugging.") - .build(); - - public static ConfigEntry logRendererGLEvent = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) - .comment("" - + "If enabled, the mod will log information about the renderer OpenGL process. \n" - + "This can be useful for debugging.") - .build(); - - public static ConfigEntry logFileReadWriteEvent = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) - .comment("" - + "If enabled, the mod will log information about file read/write operations. \n" - + "This can be useful for debugging.") - .build(); - - public static ConfigEntry logFileSubDimEvent = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) - .comment("" - + "If enabled, the mod will log information about file sub-dimension operations. \n" - + "This can be useful for debugging.") - .build(); - - public static ConfigEntry logNetworkEvent = new ConfigEntry.Builder() - .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) - .comment("" - + "If enabled, the mod will log information about network operations. \n" - + "This can be useful for debugging.") - .build(); - } - } - - - public static class Buffers - { - public static ConfigEntry gpuUploadMethod = new ConfigEntry.Builder() - .set(EGpuUploadMethod.AUTO) - .comment("" - + "What method should be used to upload geometry to the GPU? \n" - + "\n" - + EGpuUploadMethod.AUTO + ": Picks the best option based on the GPU you have. \n" - + EGpuUploadMethod.BUFFER_STORAGE + ": Default for NVIDIA if OpenGL 4.5 is supported. \n" - + " Fast rendering, no stuttering. \n" - + EGpuUploadMethod.SUB_DATA + ": Backup option for NVIDIA. \n" - + " Fast rendering but may stutter when uploading. \n" - + EGpuUploadMethod.BUFFER_MAPPING + ": Slow rendering but won't stutter when uploading. Possibly the best option for integrated GPUs. \n" - + " Default option for AMD/Intel. \n" - + " May end up storing buffers in System memory. \n" - + " Fast rendering if in GPU memory, slow if in system memory, \n" - + " but won't stutter when uploading. \n" - + EGpuUploadMethod.DATA + ": Fast rendering but will stutter when uploading. \n" - + " Backup option for AMD/Intel. \n" - + " Fast rendering but may stutter when uploading. \n" - + "\n" - + "If you don't see any difference when changing these settings, or the world looks corrupted: \n" - + "Restart the game to clear the old buffers.") - .build(); - - public static ConfigEntry gpuUploadPerMegabyteInMilliseconds = new ConfigEntry.Builder() - .setMinDefaultMax(0, 0, 50) - .comment("" - + "How long should a buffer wait per Megabyte of data uploaded?\n" - + "Helpful resource for frame times: https://fpstoms.com \n" - + "\n" - + "Longer times may reduce stuttering but will make fake chunks \n" - + " transition and load slower. Change this to [0] for no timeout.\n" - + "\n" - + "NOTE:\n" - + "Before changing this config, try changing \"GPU Upload methods\"\n" - + " and determined the best method for your hardware first.") - .build(); - - public static ConfigEntry rebuildTimes = new ConfigEntry.Builder() - .set(EBufferRebuildTimes.NORMAL) - .comment("" - + "How frequently should vertex buffers (geometry) be rebuilt and sent to the GPU? \n" - + "Higher settings may cause stuttering, but will prevent holes in the world") - .build(); - } - } - - - public static class AutoUpdater - { - public static ConfigEntry enableAutoUpdater = new ConfigEntry.Builder() - .set(false) // Keep this as false for development but should be set to true when released - .comment("Automatically checks for updates on game launch") - .build(); - - public static ConfigEntry promptForUpdate = new ConfigEntry.Builder() - .set(true) - .comment("When there is a new update available it would prompt the user whether they would like to update \n" - + "If set to false then it would update the mod in the background without informing/annoying the user \n" - + "So it is recommended to keep it off unless you are always sure you want the mod to be on the latest version") - .build(); - } + } + + public static class GpuBuffers + { + public static ConfigEntry gpuUploadMethod = new ConfigEntry.Builder() + .set(EGpuUploadMethod.AUTO) + .comment("" + + "What method should be used to upload geometry to the GPU? \n" + + "\n" + + EGpuUploadMethod.AUTO + ": Picks the best option based on the GPU you have. \n" + + "\n" + + EGpuUploadMethod.BUFFER_STORAGE + ": Default if OpenGL 4.5 is supported. \n" + + " Fast rendering, no stuttering. \n" + + "\n" + + EGpuUploadMethod.SUB_DATA + ": Backup option for NVIDIA. \n" + + " Fast rendering but may stutter when uploading. \n" + + "\n" + + EGpuUploadMethod.BUFFER_MAPPING + ": Slow rendering but won't stutter when uploading. \n" + + " Generally the best option for integrated GPUs. \n" + + " Default option for AMD/Intel if OpenGL 4.5 isn't supported. \n" + + " May end up storing buffers in System memory. \n" + + " Fast rendering if in GPU memory, slow if in system memory, \n" + + " but won't stutter when uploading. \n" + + "\n" + + EGpuUploadMethod.DATA + ": Fast rendering but will stutter when uploading. \n" + + " Backup option for AMD/Intel. \n" + + " Fast rendering but may stutter when uploading. \n" + + "\n" + + "If you don't see any difference when changing these settings, \n" + + "or the world looks corrupted: restart your game." + + "") + .build(); + + public static ConfigEntry gpuUploadPerMegabyteInMilliseconds = new ConfigEntry.Builder() + .setMinDefaultMax(0, 0, 50) + .comment("" + + "How long should a buffer wait per Megabyte of data uploaded? \n" + + "Helpful resource for frame times: https://fpstoms.com \n" + + "\n" + + "Longer times may reduce stuttering but will make fake chunks \n" + + "transition and load slower. Change this to [0] for no timeout. \n" + + "\n" + + "NOTE:\n" + + "Before changing this config, try changing the \"GPU Upload method\" first. \n" + + "") + .build(); + + // deprecated and not implemented, can be made public if we ever re-implement it + @Deprecated + private static ConfigEntry rebuildTimes = new ConfigEntry.Builder() + .set(EBufferRebuildTimes.NORMAL) + .comment("" + + "How frequently should vertex buffers (geometry) be rebuilt and sent to the GPU? \n" + + "Higher settings may cause stuttering, but will prevent holes in the world") + .build(); + } + + public static class AutoUpdater + { + public static ConfigEntry enableAutoUpdater = new ConfigEntry.Builder() + .set(!ModInfo.IS_DEV_BUILD) // hide the update notification in dev builds + .comment("" + + "Automatically check for updates on game launch?") + .build(); + + public static ConfigEntry automaticallyUpdate = new ConfigEntry.Builder() + .set(true) + .comment("" + + "Should Distant Horizons silently, automatically download and install new versions? " + + "") + .build(); + } + + public static class Logging + { + // TODO add change all option + // TODO default to error chat and info file + public static ConfigEntry logWorldGenEvent = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) + .comment("" + + "If enabled, the mod will log information about the world generation process. \n" + + "This can be useful for debugging.") + .build(); + + public static ConfigEntry logWorldGenPerformance = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_FILE) + .comment("" + + "If enabled, the mod will log performance about the world generation process. \n" + + "This can be useful for debugging.") + .build(); + + public static ConfigEntry logWorldGenLoadEvent = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_FILE) + .comment("" + + "If enabled, the mod will log information about the world generation process. \n" + + "This can be useful for debugging.") + .build(); + + public static ConfigEntry logLodBuilderEvent = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) + .comment("" + + "If enabled, the mod will log information about the LOD generation process. \n" + + "This can be useful for debugging.") + .build(); + + public static ConfigEntry logRendererBufferEvent = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) + .comment("" + + "If enabled, the mod will log information about the renderer buffer process. \n" + + "This can be useful for debugging.") + .build(); + + public static ConfigEntry logRendererGLEvent = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) + .comment("" + + "If enabled, the mod will log information about the renderer OpenGL process. \n" + + "This can be useful for debugging.") + .build(); + + public static ConfigEntry logFileReadWriteEvent = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) + .comment("" + + "If enabled, the mod will log information about file read/write operations. \n" + + "This can be useful for debugging.") + .build(); + + public static ConfigEntry logFileSubDimEvent = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) + .comment("" + + "If enabled, the mod will log information about file sub-dimension operations. \n" + + "This can be useful for debugging.") + .build(); + + public static ConfigEntry logNetworkEvent = new ConfigEntry.Builder() + .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE) + .comment("" + + "If enabled, the mod will log information about network operations. \n" + + "This can be useful for debugging.") + .build(); + } + + public static class Debugging + { + public static ConfigEntry rendererMode = new ConfigEntry.Builder() + .set(ERendererMode.DEFAULT) + .comment("" + + "What renderer is active? \n" + + "\n" + + ERendererMode.DEFAULT + ": Default lod renderer \n" + + ERendererMode.DEBUG + ": Debug testing renderer \n" + + ERendererMode.DISABLED + ": Disable rendering") + .build(); + + public static ConfigEntry debugMode = new ConfigEntry.Builder() + .set(EDebugMode.OFF) + .comment("" + + "Should specialized colors/rendering modes be used? \n" + + "\n" + + EDebugMode.OFF + ": Fake chunks will be drawn with their normal colors. \n" + + EDebugMode.SHOW_DETAIL + ": Fake chunks color will be based on their detail level. \n" + + EDebugMode.SHOW_GENMODE + ": Fake chunks color will be based on their distant generation mode. \n" + + EDebugMode.SHOW_OVERLAPPING_QUADS + ": Fake chunks will be drawn with total white, but overlapping quads will be drawn with red. \n" + + " but overlapping quads will be drawn with red, drawn as a wireframe.") + .build(); + + public static ConfigEntry renderWireframe = new ConfigEntry.Builder() + .set(false) + .comment("" + + "If enabled the LODs will render as wireframe." + + "") + .build(); + + + // TODO add LOD-only mode to this + public static ConfigEntry enableDebugKeybindings = new ConfigEntry.Builder() + .set(false) + .comment("" + + "If true the F8 key can be used to cycle through the different debug modes. \n" + + "and the F6 key can be used to enable and disable LOD rendering.") + .build(); + + public static ConfigEntry lodOnlyMode = new ConfigEntry.Builder() + .set(false) + .comment("" + + "If enabled this will disable (most) vanilla Minecraft rendering. \n" + + "\n" + + "NOTE: Do not report any issues when this mode is on! \n" + + " This setting is only for fun and debugging. \n" + + " Mod compatibility is not guaranteed.") + .build(); + + + + // can be set to public to show in the config file and UI + private static ConfigCategory exampleConfigScreen = new ConfigCategory.Builder() + .set(ExampleConfigScreen.class) + .build(); + + /** This class is used to debug the different features of the config GUI */ + public static class ExampleConfigScreen + { + // Defined in the lang, just a note about this screen + public static ConfigUIComment debugConfigScreenNote = new ConfigUIComment(); + + public static ConfigEntry boolTest = new ConfigEntry.Builder() + .set(false) + .build(); + + public static ConfigEntry byteTest = new ConfigEntry.Builder() + .set((byte) 8) + .build(); + + public static ConfigEntry intTest = new ConfigEntry.Builder() + .set(69420) + .build(); + + public static ConfigEntry doubleTest = new ConfigEntry.Builder() + .set(420.69d) + .build(); + + public static ConfigEntry shortTest = new ConfigEntry.Builder() + .set((short) 69) + .build(); + + public static ConfigEntry longTest = new ConfigEntry.Builder() + .set(42069L) + .build(); + + public static ConfigEntry floatTest = new ConfigEntry.Builder() + .set(0.42069f) + .build(); + + public static ConfigEntry stringTest = new ConfigEntry.Builder() + .set("Test input box") + .build(); + + public static ConfigEntry> listTest = new ConfigEntry.Builder>() + .set(new ArrayList(Arrays.asList("option 1", "option 2", "option 3"))) + .build(); + + public static ConfigEntry> mapTest = new ConfigEntry.Builder>() + .set(new HashMap()) + .build(); + + public static ConfigCategory categoryTest = new ConfigCategory.Builder().set(CategoryTest.class).build(); + + public static ConfigEntry linkableTest = new ConfigEntry.Builder() + .set(420) + .build(); + + + public static class CategoryTest + { + // The name of this can be anything as it will be overwritten by the name of the linked object + public static ConfigLinkedEntry linkableTest = new ConfigLinkedEntry(ExampleConfigScreen.linkableTest); + } + } + + } + + } + } } diff --git a/core/src/main/java/com/seibel/lod/core/config/eventHandlers/RenderCacheConfigEventHandler.java b/core/src/main/java/com/seibel/lod/core/config/eventHandlers/RenderCacheConfigEventHandler.java index 535a72522..922cb7695 100644 --- a/core/src/main/java/com/seibel/lod/core/config/eventHandlers/RenderCacheConfigEventHandler.java +++ b/core/src/main/java/com/seibel/lod/core/config/eventHandlers/RenderCacheConfigEventHandler.java @@ -40,14 +40,14 @@ public class RenderCacheConfigEventHandler implements IConfigListener boolean refreshRenderData = false; - EVerticalQuality newVerticalQuality = Config.Client.Graphics.Quality.verticalQuality.get(); + EVerticalQuality newVerticalQuality = Config.Client.Advanced.Graphics.Quality.verticalQuality.get(); if (this.previousVerticalQualitySetting != newVerticalQuality) { this.previousVerticalQualitySetting = newVerticalQuality; refreshRenderData = true; } - EHorizontalResolution newHorizontalResolution = Config.Client.Graphics.Quality.drawResolution.get(); + EHorizontalResolution newHorizontalResolution = Config.Client.Advanced.Graphics.Quality.drawResolution.get(); if (this.previousHorizontalResolution != newHorizontalResolution) { this.previousHorizontalResolution = newHorizontalResolution; diff --git a/core/src/main/java/com/seibel/lod/core/config/types/ConfigLinkedEntry.java b/core/src/main/java/com/seibel/lod/core/config/types/ConfigLinkedEntry.java index 493e705d1..387032d22 100644 --- a/core/src/main/java/com/seibel/lod/core/config/types/ConfigLinkedEntry.java +++ b/core/src/main/java/com/seibel/lod/core/config/types/ConfigLinkedEntry.java @@ -10,7 +10,7 @@ import com.seibel.lod.core.config.types.enums.ConfigEntryAppearance; */ public class ConfigLinkedEntry extends AbstractConfigType { public ConfigLinkedEntry(AbstractConfigType value) { - super(ConfigEntryAppearance.ONLY_SHOW, value); + super(ConfigEntryAppearance.ONLY_IN_GUI, value); } /** Appearance shouldn't be changed */ diff --git a/core/src/main/java/com/seibel/lod/core/config/types/ConfigUIComment.java b/core/src/main/java/com/seibel/lod/core/config/types/ConfigUIComment.java index 78a570b69..c28b92ce0 100644 --- a/core/src/main/java/com/seibel/lod/core/config/types/ConfigUIComment.java +++ b/core/src/main/java/com/seibel/lod/core/config/types/ConfigUIComment.java @@ -9,7 +9,7 @@ import com.seibel.lod.core.config.types.enums.ConfigEntryAppearance; */ public class ConfigUIComment extends AbstractConfigType{ public ConfigUIComment() { - super(ConfigEntryAppearance.ONLY_SHOW, ""); + super(ConfigEntryAppearance.ONLY_IN_GUI, ""); } /** Appearance shouldn't be changed */ diff --git a/core/src/main/java/com/seibel/lod/core/config/types/enums/ConfigEntryAppearance.java b/core/src/main/java/com/seibel/lod/core/config/types/enums/ConfigEntryAppearance.java index 731d6f767..0679e1119 100644 --- a/core/src/main/java/com/seibel/lod/core/config/types/enums/ConfigEntryAppearance.java +++ b/core/src/main/java/com/seibel/lod/core/config/types/enums/ConfigEntryAppearance.java @@ -6,11 +6,12 @@ package com.seibel.lod.core.config.types.enums; * * @author coolGi */ -public enum ConfigEntryAppearance { +public enum ConfigEntryAppearance +{ /** Defeat option */ ALL(true, true), /** Will only show the option in the UI. The option will be reverted on game restart */ - ONLY_SHOW(true, false), + ONLY_IN_GUI(true, false), /** Only show the option in the file. There would be no way to access it using the UI */ ONLY_IN_FILE(true, false); @@ -18,6 +19,7 @@ public enum ConfigEntryAppearance { public final boolean showInGui; /** Sets whether to save an option,
If set to false, the option will be reset on game restart */ public final boolean showInFile; + ConfigEntryAppearance(boolean showInGui, boolean showInFile) { // If both are false then the config won't touch the option, but it would still be accessable if explicitly called this.showInGui = showInGui; this.showInFile = showInFile; diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/BufferQuad.java b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/BufferQuad.java index 7ff6a51b2..5650011e3 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/BufferQuad.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/BufferQuad.java @@ -252,7 +252,7 @@ public final class BufferQuad // quad width should only be limited when earth curvature is enabled int maxQuadWidth = NORMAL_MAX_QUAD_WIDTH; - if (Config.Client.Graphics.AdvancedGraphics.earthCurveRatio.get() != 0) + if (Config.Client.Advanced.Graphics.AdvancedGraphics.earthCurveRatio.get() != 0) { maxQuadWidth = MAX_QUAD_WIDTH_FOR_EARTH_CURVATURE; } diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java index b668f5ede..61bb1d4f1 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java @@ -120,7 +120,7 @@ public class ColumnRenderBuffer extends AbstractRenderBuffer private static void uploadBuffersDirect(GLVertexBuffer[] vbos, Iterator iter, EGpuUploadMethod method) throws InterruptedException { long remainingNS = 0; - long BPerNS = Config.Client.Advanced.Buffers.gpuUploadPerMegabyteInMilliseconds.get(); + long BPerNS = Config.Client.Advanced.GpuBuffers.gpuUploadPerMegabyteInMilliseconds.get(); int vboIndex = 0; while (iter.hasNext()) { diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java index 891220284..62119c66f 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java @@ -7,7 +7,6 @@ import com.seibel.lod.core.config.Config; import com.seibel.lod.core.config.listeners.ConfigChangeListener; import com.seibel.lod.core.dataObjects.render.ColumnRenderSource; import com.seibel.lod.core.dataObjects.render.columnViews.ColumnArrayView; -import com.seibel.lod.core.dataObjects.transformers.DataRenderTransformer; import com.seibel.lod.core.enums.ELodDirection; import com.seibel.lod.core.level.IDhClientLevel; import com.seibel.lod.core.logging.ConfigBasedLogger; @@ -35,7 +34,7 @@ import java.util.concurrent.ThreadPoolExecutor; public class ColumnRenderBufferBuilder { public static final ConfigBasedLogger EVENT_LOGGER = new ConfigBasedLogger(LogManager.getLogger(), - () -> Config.Client.Advanced.Debugging.DebugSwitch.logRendererBufferEvent.get()); + () -> Config.Client.Advanced.Logging.logRendererBufferEvent.get()); private static final Logger LOGGER = DhLoggerBuilder.getLogger(); @@ -66,12 +65,12 @@ public class ColumnRenderBufferBuilder { try { - boolean enableTransparency = Config.Client.Graphics.Quality.transparency.get().tranparencyEnabled; + boolean enableTransparency = Config.Client.Advanced.Graphics.Quality.transparency.get().tranparencyEnabled; EVENT_LOGGER.trace("RenderRegion start QuadBuild @ "+renderSource.sectionPos); - boolean enableSkyLightCulling = Config.Client.Graphics.AdvancedGraphics.enableCaveCulling.get(); + boolean enableSkyLightCulling = Config.Client.Advanced.Graphics.AdvancedGraphics.enableCaveCulling.get(); - int skyLightCullingBelow = Config.Client.Graphics.AdvancedGraphics.caveCullingHeight.get(); + int skyLightCullingBelow = Config.Client.Advanced.Graphics.AdvancedGraphics.caveCullingHeight.get(); // FIXME: Clamp also to the max world height. skyLightCullingBelow = Math.max(skyLightCullingBelow, clientLevel.getMinY()); @@ -371,14 +370,14 @@ public class ColumnRenderBufferBuilder // static setup if (configListener == null) { - configListener = new ConfigChangeListener<>(Config.Client.Advanced.Threading.numberOfBufferBuilderThreads, (threadCount) -> { setThreadPoolSize(threadCount); }); + configListener = new ConfigChangeListener<>(Config.Client.Advanced.MultiThreading.numberOfBufferBuilderThreads, (threadCount) -> { setThreadPoolSize(threadCount); }); } if (bufferBuilderThreadPool == null || bufferBuilderThreadPool.isTerminated()) { LOGGER.info("Starting "+ ColumnRenderBufferBuilder.class.getSimpleName()); - setThreadPoolSize(Config.Client.Advanced.Threading.numberOfBufferBuilderThreads.get()); + setThreadPoolSize(Config.Client.Advanced.MultiThreading.numberOfBufferBuilderThreads.get()); } } public static void setThreadPoolSize(int threadPoolSize) diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/CubicLodTemplate.java b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/CubicLodTemplate.java index f73edb353..00c97159d 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/CubicLodTemplate.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/CubicLodTemplate.java @@ -65,10 +65,9 @@ public class CubicLodTemplate boolean fullBright = false; switch (debugging) { case OFF: - case SHOW_WIREFRAME: { - float saturationMultiplier = Config.Client.Graphics.AdvancedGraphics.saturationMultiplier.get().floatValue(); - float brightnessMultiplier = Config.Client.Graphics.AdvancedGraphics.brightnessMultiplier.get().floatValue(); + float saturationMultiplier = Config.Client.Advanced.Graphics.AdvancedGraphics.saturationMultiplier.get().floatValue(); + float brightnessMultiplier = Config.Client.Advanced.Graphics.AdvancedGraphics.brightnessMultiplier.get().floatValue(); if (saturationMultiplier == 1.0 && brightnessMultiplier == 1.0) { color = RenderDataPointUtil.getColor(data); @@ -84,28 +83,24 @@ public class CubicLodTemplate break; } case SHOW_DETAIL: - case SHOW_DETAIL_WIREFRAME: { color = LodUtil.DEBUG_DETAIL_LEVEL_COLORS[detailLevel]; fullBright = true; break; } case SHOW_GENMODE: - case SHOW_GENMODE_WIREFRAME: { color = LodUtil.DEBUG_DETAIL_LEVEL_COLORS[RenderDataPointUtil.getGenerationMode(data)]; fullBright = true; break; } case SHOW_OVERLAPPING_QUADS: - case SHOW_OVERLAPPING_QUADS_WIREFRAME: { color = ColorUtil.WHITE; fullBright = true; break; } case SHOW_RENDER_SOURCE_FLAG: - case SHOW_RENDER_SOURCE_FLAG_WIREFRAME: { color = debugSource == null ? ColorUtil.RED : debugSource.color; fullBright = true; diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/LodQuadBuilder.java b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/LodQuadBuilder.java index a6c53ba6b..fc675f6db 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/LodQuadBuilder.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/render/bufferBuilding/LodQuadBuilder.java @@ -765,9 +765,9 @@ public class LodQuadBuilder return i; } - /** Returns how many Buffers will be needed to render opaque quads in this builder. */ + /** Returns how many GpuBuffers will be needed to render opaque quads in this builder. */ public int getCurrentNeededOpaqueVertexBufferCount() { return MathUtil.ceilDiv(this.getCurrentOpaqueQuadsCount(), AbstractRenderBuffer.MAX_QUADS_PER_BUFFER); } - /** Returns how many Buffers will be needed to render transparent quads in this builder. */ + /** Returns how many GpuBuffers will be needed to render transparent quads in this builder. */ public int getCurrentNeededTransparentVertexBufferCount() { if (!this.doTransparency) diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/ChunkToLodBuilder.java b/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/ChunkToLodBuilder.java index 59a1e16ea..833171c60 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/ChunkToLodBuilder.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/ChunkToLodBuilder.java @@ -16,7 +16,7 @@ import org.apache.logging.log4j.LogManager; //FIXME: To-Be-Used class public class ChunkToLodBuilder { - public static final ConfigBasedLogger LOGGER = new ConfigBasedLogger(LogManager.getLogger(), () -> Config.Client.Advanced.Debugging.DebugSwitch.logLodBuilderEvent.get()); + public static final ConfigBasedLogger LOGGER = new ConfigBasedLogger(LogManager.getLogger(), () -> Config.Client.Advanced.Logging.logLodBuilderEvent.get()); private static final IMinecraftClientWrapper MC = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class); public static final long MAX_TICK_TIME_NS = 1000000000L / 20L; diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/DataRenderTransformer.java b/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/DataRenderTransformer.java index 82f3a9c4f..5a2600a05 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/DataRenderTransformer.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/DataRenderTransformer.java @@ -6,7 +6,6 @@ import com.seibel.lod.core.dataObjects.fullData.sources.interfaces.IFullDataSour import com.seibel.lod.core.dataObjects.render.ColumnRenderLoader; import com.seibel.lod.core.dataObjects.render.ColumnRenderSource; import com.seibel.lod.core.dependencyInjection.SingletonInjector; -import com.seibel.lod.core.file.fullDatafile.FullDataFileHandler; import com.seibel.lod.core.level.IDhClientLevel; import com.seibel.lod.core.logging.DhLoggerBuilder; import com.seibel.lod.core.util.ThreadUtil; @@ -78,14 +77,14 @@ public class DataRenderTransformer // static setup if (configListener == null) { - configListener = new ConfigChangeListener<>(Config.Client.Advanced.Threading.numberOfDataConverterThreads, (threadCount) -> { setThreadPoolSize(threadCount); }); + configListener = new ConfigChangeListener<>(Config.Client.Advanced.MultiThreading.numberOfDataConverterThreads, (threadCount) -> { setThreadPoolSize(threadCount); }); } if (transformerThreadPool == null || transformerThreadPool.isTerminated()) { LOGGER.info("Starting "+DataRenderTransformer.class.getSimpleName()); - setThreadPoolSize(Config.Client.Advanced.Threading.numberOfDataConverterThreads.get()); + setThreadPoolSize(Config.Client.Advanced.MultiThreading.numberOfDataConverterThreads.get()); } } public static void setThreadPoolSize(int threadPoolSize) { transformerThreadPool = ThreadUtil.makeThreadPool(threadPoolSize, "Data/Render Transformer"); } diff --git a/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/FullDataToRenderDataTransformer.java b/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/FullDataToRenderDataTransformer.java index 361f91264..5da53e500 100644 --- a/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/FullDataToRenderDataTransformer.java +++ b/core/src/main/java/com/seibel/lod/core/dataObjects/transformers/FullDataToRenderDataTransformer.java @@ -59,7 +59,7 @@ public class FullDataToRenderDataTransformer { final DhSectionPos pos = fullDataSource.getSectionPos(); final byte dataDetail = fullDataSource.getDataDetailLevel(); - final int vertSize = Config.Client.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(fullDataSource.getDataDetailLevel()); + final int vertSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(fullDataSource.getDataDetailLevel()); final ColumnRenderSource columnSource = new ColumnRenderSource(pos, vertSize, level.getMinY()); if (fullDataSource.isEmpty()) { @@ -109,7 +109,7 @@ public class FullDataToRenderDataTransformer { final DhSectionPos pos = data.getSectionPos(); final byte dataDetail = data.getDataDetailLevel(); - final int vertSize = Config.Client.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(data.getDataDetailLevel()); + final int vertSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(data.getDataDetailLevel()); final ColumnRenderSource columnSource = new ColumnRenderSource(pos, vertSize, level.getMinY()); if (data.isEmpty()) { diff --git a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataFileHandler.java b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataFileHandler.java index 75e307a0e..2e4253df0 100644 --- a/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataFileHandler.java +++ b/core/src/main/java/com/seibel/lod/core/file/fullDatafile/FullDataFileHandler.java @@ -3,13 +3,11 @@ package com.seibel.lod.core.file.fullDatafile; import com.google.common.collect.HashMultimap; import com.seibel.lod.core.config.Config; import com.seibel.lod.core.config.listeners.ConfigChangeListener; -import com.seibel.lod.core.config.types.ConfigEntry; import com.seibel.lod.core.dataObjects.fullData.accessor.ChunkSizedFullDataAccessor; import com.seibel.lod.core.dataObjects.fullData.sources.*; import com.seibel.lod.core.dataObjects.fullData.sources.CompleteFullDataSource; import com.seibel.lod.core.dataObjects.fullData.sources.interfaces.IFullDataSource; import com.seibel.lod.core.dataObjects.fullData.sources.interfaces.IIncompleteFullDataSource; -import com.seibel.lod.core.dataObjects.transformers.DataRenderTransformer; import com.seibel.lod.core.util.FileUtil; import com.seibel.lod.core.file.metaData.BaseMetaData; import com.seibel.lod.core.level.IDhLevel; @@ -479,14 +477,14 @@ public class FullDataFileHandler implements IFullDataSourceProvider // static setup if (configListener == null) { - configListener = new ConfigChangeListener<>(Config.Client.Advanced.Threading.numberOfFileHandlerThreads, (threadCount) -> { setThreadPoolSize(threadCount); }); + configListener = new ConfigChangeListener<>(Config.Client.Advanced.MultiThreading.numberOfFileHandlerThreads, (threadCount) -> { setThreadPoolSize(threadCount); }); } if (fileHandlerThreadPool == null || fileHandlerThreadPool.isTerminated()) { LOGGER.info("Starting "+FullDataFileHandler.class.getSimpleName()); - setThreadPoolSize(Config.Client.Advanced.Threading.numberOfFileHandlerThreads.get()); + setThreadPoolSize(Config.Client.Advanced.MultiThreading.numberOfFileHandlerThreads.get()); } } public static void setThreadPoolSize(int threadPoolSize) { fileHandlerThreadPool = ThreadUtil.makeThreadPool(threadPoolSize, FullDataFileHandler.class.getSimpleName()+"Thread"); } diff --git a/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderSourceFileHandler.java b/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderSourceFileHandler.java index 24893a498..9ca359e9b 100644 --- a/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderSourceFileHandler.java +++ b/core/src/main/java/com/seibel/lod/core/file/renderfile/RenderSourceFileHandler.java @@ -219,7 +219,7 @@ public class RenderSourceFileHandler implements ILodRenderSourceProvider public CompletableFuture onCreateRenderFileAsync(RenderMetaDataFile file) { - final int verticalSize = Config.Client.Graphics.Quality.verticalQuality.get() + final int verticalSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get() .calculateMaxVerticalData((byte) (file.pos.sectionDetailLevel - ColumnRenderSource.SECTION_SIZE_OFFSET)); return CompletableFuture.completedFuture( diff --git a/core/src/main/java/com/seibel/lod/core/file/structure/ClientOnlySaveStructure.java b/core/src/main/java/com/seibel/lod/core/file/structure/ClientOnlySaveStructure.java index 06be792bc..c46286cdb 100644 --- a/core/src/main/java/com/seibel/lod/core/file/structure/ClientOnlySaveStructure.java +++ b/core/src/main/java/com/seibel/lod/core/file/structure/ClientOnlySaveStructure.java @@ -58,7 +58,7 @@ public class ClientOnlySaveStructure extends AbstractSaveStructure { return this.levelToFileMap.computeIfAbsent(level, (newLevel) -> { - if (Config.Client.Multiplayer.multiDimensionRequiredSimilarity.get() == 0) + if (Config.Client.Advanced.Multiplayer.multiDimensionRequiredSimilarity.get() == 0) { if (this.fileMatcher != null) { @@ -184,11 +184,7 @@ public class ClientOnlySaveStructure extends AbstractSaveStructure // determine the auto folder name format - EServerFolderNameMode folderNameMode = Config.Client.Multiplayer.serverFolderNameMode.get(); - if (folderNameMode == EServerFolderNameMode.AUTO) - { - folderNameMode = EServerFolderNameMode.NAME_ONLY; - } + EServerFolderNameMode folderNameMode = Config.Client.Advanced.Multiplayer.serverFolderNameMode.get(); String serverName = MC_CLIENT.getCurrentServerName().replaceAll(INVALID_FILE_CHARACTERS_REGEX, ""); String serverMcVersion = MC_CLIENT.getCurrentServerVersion().replaceAll(INVALID_FILE_CHARACTERS_REGEX, ""); diff --git a/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimCompare.java b/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimCompare.java index 07060760c..df5bc30bc 100644 --- a/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimCompare.java +++ b/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimCompare.java @@ -78,7 +78,7 @@ public class SubDimCompare implements Comparable /** Returns true if this sub dimension is close enough to be considered a valid sub dimension */ public boolean isValidSubDim() { - double minimumSimilarityRequired = Config.Client.Multiplayer.multiDimensionRequiredSimilarity.get(); + double minimumSimilarityRequired = Config.Client.Advanced.Multiplayer.multiDimensionRequiredSimilarity.get(); return this.getPercentEqual() >= minimumSimilarityRequired || this.playerPosDist <= MAX_SIMILAR_PLAYER_POS_DISTANCE_IN_BLOCKS; } diff --git a/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimensionLevelMatcher.java b/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimensionLevelMatcher.java index 13abef23a..7cdfe3146 100644 --- a/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimensionLevelMatcher.java +++ b/core/src/main/java/com/seibel/lod/core/file/subDimMatching/SubDimensionLevelMatcher.java @@ -42,7 +42,7 @@ public class SubDimensionLevelMatcher implements AutoCloseable { private static final IMinecraftClientWrapper MC_CLIENT = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class); public static final ConfigBasedLogger LOGGER = new ConfigBasedLogger(LogManager.getLogger(), - () -> Config.Client.Advanced.Debugging.DebugSwitch.logFileSubDimEvent.get()); + () -> Config.Client.Advanced.Logging.logFileSubDimEvent.get()); private final ExecutorService matcherThread = ThreadUtil.makeSingleThreadPool("Level-To-File-Matcher"); diff --git a/core/src/main/java/com/seibel/lod/core/generation/BatchGenerator.java b/core/src/main/java/com/seibel/lod/core/generation/BatchGenerator.java index 548130f18..36648639e 100644 --- a/core/src/main/java/com/seibel/lod/core/generation/BatchGenerator.java +++ b/core/src/main/java/com/seibel/lod/core/generation/BatchGenerator.java @@ -147,7 +147,7 @@ public class BatchGenerator implements IDhApiWorldGenerator @Override public boolean isBusy() { - return this.generationEnvironment.getEventCount() > Math.max(Config.Client.Advanced.Threading.numberOfWorldGenerationThreads.get().intValue(), 1) * MAX_QUEUED_TASKS; + return this.generationEnvironment.getEventCount() > Math.max(Config.Client.Advanced.MultiThreading.numberOfWorldGenerationThreads.get().intValue(), 1) * MAX_QUEUED_TASKS; } diff --git a/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java b/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java index e3d9a7a10..6eb15d9e7 100644 --- a/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java +++ b/core/src/main/java/com/seibel/lod/core/generation/WorldGenerationQueue.java @@ -82,7 +82,7 @@ public class WorldGenerationQueue implements Closeable this.largestDataDetail = generator.getLargestDataDetailLevel(); this.smallestDataDetail = generator.getSmallestDataDetailLevel(); - int treeWidth = Config.Client.Graphics.Quality.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH * 2; // TODO the *2 is to allow for generation edge cases, and should probably be removed at some point + int treeWidth = Config.Client.Advanced.Graphics.Quality.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH * 2; // TODO the *2 is to allow for generation edge cases, and should probably be removed at some point byte treeMinDetailLevel = LodUtil.BLOCK_DETAIL_LEVEL; // the tree shouldn't need to go this low, but just in case this.waitingTaskQuadTree = new QuadTree<>(treeWidth, DhBlockPos2D.ZERO /*the quad tree will be re-centered later*/, treeMinDetailLevel); @@ -429,7 +429,7 @@ public class WorldGenerationQueue implements Closeable byte granularity, byte targetDataDetail, Consumer generationCompleteConsumer) { - EDhApiDistantGeneratorMode generatorMode = Config.Client.WorldGenerator.distantGeneratorMode.get(); + EDhApiDistantGeneratorMode generatorMode = Config.Client.Advanced.WorldGenerator.distantGeneratorMode.get(); return this.generator.generateChunks(chunkPosMin.x, chunkPosMin.z, granularity, targetDataDetail, generatorMode, worldGeneratorThreadPool, (generatedObjectArray) -> { try @@ -440,7 +440,7 @@ public class WorldGenerationQueue implements Closeable catch (ClassCastException e) { DhLoggerBuilder.getLogger().error("World generator return type incorrect. Error: ["+e.getMessage()+"]. World generator disabled.", e); - Config.Client.WorldGenerator.enableDistantGeneration.set(false); + Config.Client.Advanced.WorldGenerator.enableDistantGeneration.set(false); } }); } @@ -460,14 +460,14 @@ public class WorldGenerationQueue implements Closeable // static setup if (configListener == null) { - configListener = new ConfigChangeListener<>(Config.Client.Advanced.Threading.numberOfWorldGenerationThreads, (threadCount) -> { setThreadPoolSize(threadCount); }); + configListener = new ConfigChangeListener<>(Config.Client.Advanced.MultiThreading.numberOfWorldGenerationThreads, (threadCount) -> { setThreadPoolSize(threadCount); }); } if (worldGeneratorThreadPool == null || worldGeneratorThreadPool.isTerminated()) { LOGGER.info("Starting "+ FullDataFileHandler.class.getSimpleName()); - setThreadPoolSize(Config.Client.Advanced.Threading.numberOfWorldGenerationThreads.get()); + setThreadPoolSize(Config.Client.Advanced.MultiThreading.numberOfWorldGenerationThreads.get()); } } public static void setThreadPoolSize(int threadPoolSize) { worldGeneratorThreadPool = ThreadUtil.makeThreadPool(threadPoolSize, "DH-Gen-Worker-Thread", Thread.MIN_PRIORITY); } diff --git a/core/src/main/java/com/seibel/lod/core/jar/updater/SelfUpdater.java b/core/src/main/java/com/seibel/lod/core/jar/updater/SelfUpdater.java index 240e28699..e75eac875 100644 --- a/core/src/main/java/com/seibel/lod/core/jar/updater/SelfUpdater.java +++ b/core/src/main/java/com/seibel/lod/core/jar/updater/SelfUpdater.java @@ -47,11 +47,12 @@ public class SelfUpdater { LOGGER.info("New version ("+ModrinthGetter.getLatestNameForVersion(mcVersion)+") of "+ ModInfo.READABLE_NAME+" is available"); - if (!Config.Client.AutoUpdater.promptForUpdate.get()) { - // Auto-update mod - updateMod(mcVersion); - return false; - } // else + if (Config.Client.Advanced.AutoUpdater.automaticallyUpdate.get()) + { + // Auto-update mod + updateMod(mcVersion); + return false; + } // else return true; } diff --git a/core/src/main/java/com/seibel/lod/core/level/AbstractDhClientLevel.java b/core/src/main/java/com/seibel/lod/core/level/AbstractDhClientLevel.java index 05be28e44..dadbac951 100644 --- a/core/src/main/java/com/seibel/lod/core/level/AbstractDhClientLevel.java +++ b/core/src/main/java/com/seibel/lod/core/level/AbstractDhClientLevel.java @@ -83,7 +83,7 @@ public abstract class AbstractDhClientLevel implements IDhClientLevel return false; } - if (clientRenderState.quadtree.blockRenderDistance != Config.Client.Graphics.Quality.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH) + if (clientRenderState.quadtree.blockRenderDistance != Config.Client.Advanced.Graphics.Quality.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH) { if (!this.ClientRenderStateRef.compareAndSet(clientRenderState, null)) { diff --git a/core/src/main/java/com/seibel/lod/core/level/DhClientServerLevel.java b/core/src/main/java/com/seibel/lod/core/level/DhClientServerLevel.java index 72faa4739..c7fd50207 100644 --- a/core/src/main/java/com/seibel/lod/core/level/DhClientServerLevel.java +++ b/core/src/main/java/com/seibel/lod/core/level/DhClientServerLevel.java @@ -65,7 +65,7 @@ public class DhClientServerLevel extends AbstractDhClientLevel implements IDhCli FileScanUtil.scanFiles(saveStructure, this.serverLevelWrapper, this.fullDataFileHandler, null); - this.worldGeneratorEnabledConfig = new AppliedConfigState<>(Config.Client.WorldGenerator.enableDistantGeneration); + this.worldGeneratorEnabledConfig = new AppliedConfigState<>(Config.Client.Advanced.WorldGenerator.enableDistantGeneration); LOGGER.info("Started "+DhClientServerLevel.class.getSimpleName()+" for "+ serverLevelWrapper +" with saves at "+saveStructure); diff --git a/core/src/main/java/com/seibel/lod/core/level/states/ClientRenderState.java b/core/src/main/java/com/seibel/lod/core/level/states/ClientRenderState.java index ede27a80b..28abd4f1b 100644 --- a/core/src/main/java/com/seibel/lod/core/level/states/ClientRenderState.java +++ b/core/src/main/java/com/seibel/lod/core/level/states/ClientRenderState.java @@ -36,7 +36,7 @@ public class ClientRenderState this.levelWrapper = dhClientLevel.getLevelWrapper(); this.renderSourceFileHandler = new RenderSourceFileHandler(fullDataSourceProvider, dhClientLevel, saveStructure.getRenderCacheFolder(this.levelWrapper)); - this.quadtree = new LodQuadTree(dhClientLevel, Config.Client.Graphics.Quality.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH, + this.quadtree = new LodQuadTree(dhClientLevel, Config.Client.Advanced.Graphics.Quality.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH, MC_CLIENT.getPlayerBlockPos().x, MC_CLIENT.getPlayerBlockPos().z, this.renderSourceFileHandler); RenderBufferHandler renderBufferHandler = new RenderBufferHandler(this.quadtree); diff --git a/core/src/main/java/com/seibel/lod/core/render/fog/LodFogConfig.java b/core/src/main/java/com/seibel/lod/core/render/fog/LodFogConfig.java index ec7686a9d..3befbb63b 100644 --- a/core/src/main/java/com/seibel/lod/core/render/fog/LodFogConfig.java +++ b/core/src/main/java/com/seibel/lod/core/render/fog/LodFogConfig.java @@ -66,7 +66,7 @@ public class LodFogConfig public static LodFogConfig generateFogConfig() { - EFogDrawMode fogMode = Config.Client.Graphics.FogQuality.fogDrawMode.get(); + EFogDrawMode fogMode = Config.Client.Advanced.Graphics.Fog.fogDrawMode.get(); if (fogMode == EFogDrawMode.USE_OPTIFINE_SETTING && OPTIFINE != null) { fogMode = OPTIFINE.getFogDrawMode(); @@ -78,17 +78,17 @@ public class LodFogConfig private LodFogConfig(EFogDrawMode fogDrawMode) { // TODO: Move these out of here - earthCurveRatio = Config.Client.Graphics.AdvancedGraphics.earthCurveRatio.get(); + earthCurveRatio = Config.Client.Advanced.Graphics.AdvancedGraphics.earthCurveRatio.get(); - noiseEnable = Config.Client.Graphics.AdvancedGraphics.NoiseSettings.noiseEnable.get(); - noiseSteps = Config.Client.Graphics.AdvancedGraphics.NoiseSettings.noiseSteps.get(); - noiseIntensity = Config.Client.Graphics.AdvancedGraphics.NoiseSettings.noiseIntensity.get().floatValue(); - noiseDropoff = Config.Client.Graphics.AdvancedGraphics.NoiseSettings.noiseDropoff.get().floatValue(); + noiseEnable = Config.Client.Advanced.Graphics.NoiseTextureSettings.noiseEnable.get(); + noiseSteps = Config.Client.Advanced.Graphics.NoiseTextureSettings.noiseSteps.get(); + noiseIntensity = Config.Client.Advanced.Graphics.NoiseTextureSettings.noiseIntensity.get().floatValue(); + noiseDropoff = Config.Client.Advanced.Graphics.NoiseTextureSettings.noiseDropoff.get().floatValue(); if (fogDrawMode != EFogDrawMode.FOG_DISABLED) { - EFogDistance fogDistance = Config.Client.Graphics.FogQuality.fogDistance.get(); + EFogDistance fogDistance = Config.Client.Advanced.Graphics.Fog.fogDistance.get(); drawNearFog = (fogDistance == EFogDistance.NEAR || fogDistance == EFogDistance.NEAR_AND_FAR); if (fogDistance == EFogDistance.FAR || fogDistance == EFogDistance.NEAR_AND_FAR) @@ -96,15 +96,15 @@ public class LodFogConfig // far fog should be drawn farFogSetting = new FogSettings( - Config.Client.Graphics.FogQuality.AdvancedFog.farFogStart.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.farFogEnd.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.farFogMin.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.farFogMax.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.farFogDensity.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.farFogType.get() + Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogStart.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogEnd.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogMin.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogMax.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogDensity.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogFalloff.get() ); - heightFogMixMode = Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMixMode.get(); + heightFogMixMode = Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMixMode.get(); if (heightFogMixMode == EHeightFogMixMode.IGNORE_HEIGHT || heightFogMixMode == EHeightFogMixMode.BASIC) { // basic fog mixing @@ -118,15 +118,15 @@ public class LodFogConfig // advanced fog mixing heightFogSetting = new FogSettings( - Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogDensity.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogEnd.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMin.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMax.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogDensity.get(), - Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogType.get() + Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogDensity.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogEnd.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMin.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMax.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogDensity.get(), + Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogFalloff.get() ); - heightFogMode = Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMode.get(); + heightFogMode = Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMode.get(); if (heightFogMode.basedOnCamera) { @@ -134,7 +134,7 @@ public class LodFogConfig } else { - heightFogHeight = Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogHeight.get().floatValue(); + heightFogHeight = Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogHeight.get().floatValue(); } } } diff --git a/core/src/main/java/com/seibel/lod/core/render/glObject/GLProxy.java b/core/src/main/java/com/seibel/lod/core/render/glObject/GLProxy.java index 9c855dc65..c241a6f18 100644 --- a/core/src/main/java/com/seibel/lod/core/render/glObject/GLProxy.java +++ b/core/src/main/java/com/seibel/lod/core/render/glObject/GLProxy.java @@ -73,7 +73,7 @@ public class GLProxy private static final Logger LOGGER = DhLoggerBuilder.getLogger(MethodHandles.lookup().lookupClass().getSimpleName()); public static final ConfigBasedLogger GL_LOGGER = new ConfigBasedLogger(LogManager.getLogger(GLProxy.class), - () -> Config.Client.Advanced.Debugging.DebugSwitch.logRendererGLEvent.get()); + () -> Config.Client.Advanced.Logging.logRendererGLEvent.get()); private static GLProxy instance = null; @@ -351,7 +351,7 @@ public class GLProxy public EGpuUploadMethod getGpuUploadMethod() { - EGpuUploadMethod method = Config.Client.Advanced.Buffers.gpuUploadMethod.get(); + EGpuUploadMethod method = Config.Client.Advanced.GpuBuffers.gpuUploadMethod.get(); if (!bufferStorageSupported && method == EGpuUploadMethod.BUFFER_STORAGE) { // if buffer storage isn't supported diff --git a/core/src/main/java/com/seibel/lod/core/render/renderer/LodRenderer.java b/core/src/main/java/com/seibel/lod/core/render/renderer/LodRenderer.java index b4f360c3c..915d769ab 100644 --- a/core/src/main/java/com/seibel/lod/core/render/renderer/LodRenderer.java +++ b/core/src/main/java/com/seibel/lod/core/render/renderer/LodRenderer.java @@ -60,10 +60,10 @@ import java.util.concurrent.TimeUnit; public class LodRenderer { public static final ConfigBasedLogger EVENT_LOGGER = new ConfigBasedLogger(LogManager.getLogger(LodRenderer.class), - () -> Config.Client.Advanced.Debugging.DebugSwitch.logRendererBufferEvent.get()); + () -> Config.Client.Advanced.Logging.logRendererBufferEvent.get()); public static ConfigBasedSpamLogger tickLogger = new ConfigBasedSpamLogger(LogManager.getLogger(LodRenderer.class), - () -> Config.Client.Advanced.Debugging.DebugSwitch.logRendererBufferEvent.get(),1); + () -> Config.Client.Advanced.Logging.logRendererBufferEvent.get(),1); public static final boolean ENABLE_DRAW_LAG_SPIKE_LOGGING = false; public static final boolean ENABLE_DUMP_GL_STATE = true; public static final long DRAW_LAG_SPIKE_THRESHOLD_NS = TimeUnit.NANOSECONDS.convert(20, TimeUnit.MILLISECONDS); @@ -154,7 +154,7 @@ public class LodRenderer drawSaveGLState.end("drawSaveGLState"); GLProxy glProxy = GLProxy.getInstance(); - if (Config.Client.Graphics.FogQuality.disableVanillaFog.get()) + if (Config.Client.Advanced.Graphics.Fog.disableVanillaFog.get()) MC_RENDER.tryDisableVanillaFog(); //===================// @@ -168,16 +168,14 @@ public class LodRenderer GL32.glViewport(0,0, MC_RENDER.getTargetFrameBufferViewportWidth(), MC_RENDER.getTargetFrameBufferViewportHeight()); GL32.glBindBuffer(GL32.GL_ARRAY_BUFFER, 0); // set the required open GL settings - ConfigEntry debugModeConfig = Config.Client.Advanced.Debugging.debugMode; - if (debugModeConfig.get() == EDebugMode.SHOW_DETAIL_WIREFRAME - || debugModeConfig.get() == EDebugMode.SHOW_GENMODE_WIREFRAME - || debugModeConfig.get() == EDebugMode.SHOW_WIREFRAME - || debugModeConfig.get() == EDebugMode.SHOW_OVERLAPPING_QUADS_WIREFRAME - || debugModeConfig.get() == EDebugMode.SHOW_RENDER_SOURCE_FLAG_WIREFRAME) { + boolean renderWireframe = Config.Client.Advanced.Debugging.renderWireframe.get(); + if (renderWireframe) + { GL32.glPolygonMode(GL32.GL_FRONT_AND_BACK, GL32.GL_LINE); //GL32.glDisable(GL32.GL_CULL_FACE); } - else { + else + { GL32.glPolygonMode(GL32.GL_FRONT_AND_BACK, GL32.GL_FILL); GL32.glEnable(GL32.GL_CULL_FACE); } @@ -187,8 +185,8 @@ public class LodRenderer - transparencyEnabled = Config.Client.Graphics.Quality.transparency.get().tranparencyEnabled; - fakeOceanFloor = Config.Client.Graphics.Quality.transparency.get().fakeTransparencyEnabled; + transparencyEnabled = Config.Client.Advanced.Graphics.Quality.transparency.get().tranparencyEnabled; + fakeOceanFloor = Config.Client.Advanced.Graphics.Quality.transparency.get().fakeTransparencyEnabled; GL32.glDisable(GL32.GL_BLEND); // We render opaque first, then transparent GL32.glDepthMask(true); @@ -236,12 +234,11 @@ public class LodRenderer //===========// profiler.popPush("LOD draw"); LagSpikeCatcher draw = new LagSpikeCatcher(); - - boolean cullingDisabled = Config.Client.Graphics.AdvancedGraphics.disableDirectionalCulling.get(); + Vec3d cameraPos = MC_RENDER.getCameraExactPosition(); DhBlockPos cameraBlockPos = MC_RENDER.getCameraBlockPosition(); Vec3f cameraDir = MC_RENDER.getLookAtVector(); - + //TODO: Directional culling bufferHandler.renderOpaque(this); @@ -312,7 +309,7 @@ public class LodRenderer { Color fogColor; - if (Config.Client.Graphics.FogQuality.fogColorMode.get() == EFogColorMode.USE_SKY_COLOR) + if (Config.Client.Advanced.Graphics.Fog.fogColorMode.get() == EFogColorMode.USE_SKY_COLOR) fogColor = MC_RENDER.getSkyColor(); else fogColor = MC_RENDER.getFogColor(partialTicks); diff --git a/core/src/main/java/com/seibel/lod/core/util/DetailDistanceUtil.java b/core/src/main/java/com/seibel/lod/core/util/DetailDistanceUtil.java index 03e9d4a83..05bc405b2 100644 --- a/core/src/main/java/com/seibel/lod/core/util/DetailDistanceUtil.java +++ b/core/src/main/java/com/seibel/lod/core/util/DetailDistanceUtil.java @@ -31,21 +31,21 @@ import com.seibel.lod.coreapi.util.MathUtil; @Deprecated public class DetailDistanceUtil { - public static byte minDetail = Config.Client.Graphics.Quality.drawResolution.get().detailLevel; + public static byte minDetail = Config.Client.Advanced.Graphics.Quality.drawResolution.get().detailLevel; private static final byte maxDetail = Byte.MAX_VALUE; private static final double minDistance = 0; - private static double distanceUnit = 16 * Config.Client.Graphics.Quality.horizontalScale.get(); - private static double maxDistance = Config.Client.Graphics.Quality.lodChunkRenderDistance.get() * 16 * 2; - private static double logBase = Math.log(Config.Client.Graphics.Quality.horizontalQuality.get().quadraticBase); + private static double distanceUnit = 16 * Config.Client.Advanced.Graphics.Quality.horizontalScale.get(); + private static double maxDistance = Config.Client.Advanced.Graphics.Quality.lodChunkRenderDistance.get() * 16 * 2; + private static double logBase = Math.log(Config.Client.Advanced.Graphics.Quality.horizontalQuality.get().quadraticBase); public static void updateSettings() { - distanceUnit = 16 * Config.Client.Graphics.Quality.horizontalScale.get(); - minDetail = Config.Client.Graphics.Quality.drawResolution.get().detailLevel; - maxDistance = Config.Client.Graphics.Quality.lodChunkRenderDistance.get() * 16 * 8; - logBase = Math.log(Config.Client.Graphics.Quality.horizontalQuality.get().quadraticBase); + distanceUnit = 16 * Config.Client.Advanced.Graphics.Quality.horizontalScale.get(); + minDetail = Config.Client.Advanced.Graphics.Quality.drawResolution.get().detailLevel; + maxDistance = Config.Client.Advanced.Graphics.Quality.lodChunkRenderDistance.get() * 16 * 8; + logBase = Math.log(Config.Client.Advanced.Graphics.Quality.horizontalQuality.get().quadraticBase); } public static double baseDistanceFunction(int detail) @@ -57,11 +57,11 @@ public class DetailDistanceUtil detail-=minDetail; - if (Config.Client.Graphics.Quality.horizontalQuality.get() == EHorizontalQuality.LOWEST) + if (Config.Client.Advanced.Graphics.Quality.horizontalQuality.get() == EHorizontalQuality.LOWEST) return ((double)detail * distanceUnit); else { - double base = Config.Client.Graphics.Quality.horizontalQuality.get().quadraticBase; + double base = Config.Client.Advanced.Graphics.Quality.horizontalQuality.get().quadraticBase; return Math.pow(base, detail) * distanceUnit; } } @@ -81,7 +81,7 @@ public class DetailDistanceUtil int detail; - if (Config.Client.Graphics.Quality.horizontalQuality.get() == EHorizontalQuality.LOWEST) + if (Config.Client.Advanced.Graphics.Quality.horizontalQuality.get() == EHorizontalQuality.LOWEST) detail = (int) (distance/distanceUnit); else detail = (int) (Math.log(distance/distanceUnit) / logBase); diff --git a/core/src/main/java/com/seibel/lod/core/util/LodUtil.java b/core/src/main/java/com/seibel/lod/core/util/LodUtil.java index 6ebda564c..23ea22372 100644 --- a/core/src/main/java/com/seibel/lod/core/util/LodUtil.java +++ b/core/src/main/java/com/seibel/lod/core/util/LodUtil.java @@ -168,11 +168,11 @@ public class LodUtil public static int computeOverdrawOffset() { int chunkRenderDist = MC_RENDER.getRenderDistance() + 1; - EVanillaOverdraw overdraw = Config.Client.Graphics.AdvancedGraphics.vanillaOverdraw.get(); + EVanillaOverdraw overdraw = EVanillaOverdraw.ALWAYS; //Config.Client.Advanced.Graphics.AdvancedGraphics.vanillaOverdraw.get(); if (overdraw == EVanillaOverdraw.ALWAYS) return Integer.MAX_VALUE; int offset; if (overdraw == EVanillaOverdraw.NEVER) { - offset = Config.Client.Graphics.AdvancedGraphics.overdrawOffset.get(); + offset = 0; //Config.Client.Advanced.Graphics.AdvancedGraphics.overdrawOffset.get(); } else { if (chunkRenderDist < MINIMUM_RENDER_DISTANCE_FOR_FAR_OVERDRAW) { offset = 1; @@ -186,8 +186,11 @@ public class LodUtil } return offset; } - - public static EdgeDistanceBooleanGrid readVanillaRenderedChunks() { + + /** not currently used since the new rendering system can't easily toggle single chunks to render */ + @Deprecated + public static EdgeDistanceBooleanGrid readVanillaRenderedChunks() + { int offset = computeOverdrawOffset(); if (offset == Integer.MAX_VALUE) return null; int renderDist = MC_RENDER.getRenderDistance() + 1; diff --git a/core/src/main/java/com/seibel/lod/core/util/RenderUtil.java b/core/src/main/java/com/seibel/lod/core/util/RenderUtil.java index 65efb4c62..dc57e8a4a 100644 --- a/core/src/main/java/com/seibel/lod/core/util/RenderUtil.java +++ b/core/src/main/java/com/seibel/lod/core/util/RenderUtil.java @@ -179,11 +179,11 @@ public class RenderUtil int vanillaBlockRenderedDistance = MC_RENDER.getRenderDistance() * LodUtil.CHUNK_WIDTH; float nearClipPlane; - if (Config.Client.Advanced.lodOnlyMode.get()) + if (Config.Client.Advanced.Debugging.lodOnlyMode.get()) { nearClipPlane = 0.1f; } - else if (Config.Client.Graphics.AdvancedGraphics.useExtendedNearClipPlane.get()) + else if (Config.Client.Advanced.Graphics.AdvancedGraphics.useExtendedNearClipPlane.get()) { nearClipPlane = Math.min(vanillaBlockRenderedDistance - LodUtil.CHUNK_WIDTH, (float) 8 * LodUtil.CHUNK_WIDTH); // allow a max near clip plane of 8 chunks } @@ -202,7 +202,7 @@ public class RenderUtil } public static int getFarClipPlaneDistanceInBlocks() { - int lodChunkDist = Config.Client.Graphics.Quality.lodChunkRenderDistance.get(); + int lodChunkDist = Config.Client.Advanced.Graphics.Quality.lodChunkRenderDistance.get(); return lodChunkDist * LodUtil.CHUNK_WIDTH; } diff --git a/core/src/main/java/com/seibel/lod/core/world/DhClientWorld.java b/core/src/main/java/com/seibel/lod/core/world/DhClientWorld.java index 028393070..b4a16547f 100644 --- a/core/src/main/java/com/seibel/lod/core/world/DhClientWorld.java +++ b/core/src/main/java/com/seibel/lod/core/world/DhClientWorld.java @@ -92,7 +92,7 @@ public class DhClientWorld extends AbstractDhWorld implements IDhClientWorld private void _clientTick() { - int newBlockRenderDistance = Config.Client.Graphics.Quality.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH; + int newBlockRenderDistance = Config.Client.Advanced.Graphics.Quality.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH; Iterator iterator = this.levels.values().iterator(); while (iterator.hasNext()) diff --git a/core/src/main/resources/assets/lod/lang/en_us.json b/core/src/main/resources/assets/lod/lang/en_us.json index af3a7165c..ee8094f7d 100644 --- a/core/src/main/resources/assets/lod/lang/en_us.json +++ b/core/src/main/resources/assets/lod/lang/en_us.json @@ -369,6 +369,12 @@ "Prompt for update", "lod.config.client.autoUpdater.promptForUpdate.@tooltip": "If disabled then when an update is available then it would update without prompting the user", + + "lod.config.client.quickEnableRendering": + "quickEnableRendering", + "lod.config.client.quickEnableRendering.@tooltip": + "quickEnableRendering tooltip", + "lod.config.client.optionsButton": "Show options button", "lod.config.client.optionsButton.@tooltip":