config renaming and add new configs to DhApi

This commit is contained in:
James Seibel
2023-06-14 21:32:10 -05:00
parent 6db6c69983
commit 6832d21a3b
39 changed files with 853 additions and 594 deletions
@@ -33,9 +33,9 @@ import com.seibel.lod.coreapi.util.MathUtil;
*
* @author James Seibel
* @author Leonardo Amato
* @version 2022-7-5
* @version 2023-6-14
*/
public enum EHorizontalResolution
public enum EMaxHorizontalResolution
{
/** render 256 LODs for each chunk */
BLOCK(16, 0),
@@ -83,12 +83,12 @@ public enum EHorizontalResolution
* 2nd dimension: An array of all LodDetails that are less than or <br>
* equal to that detailLevel
*/
private static EHorizontalResolution[][] lowerDetailArrays;
private static EMaxHorizontalResolution[][] lowerDetailArrays;
EHorizontalResolution(int newLengthCount, int newDetailLevel)
EMaxHorizontalResolution(int newLengthCount, int newDetailLevel)
{
this.detailLevel = (byte) newDetailLevel;
this.dataPointLengthCount = newLengthCount;
@@ -128,20 +128,20 @@ public enum EHorizontalResolution
* Returns an array of all LodDetails that have a detail level
* that is less than or equal to the given LodDetail
*/
public static EHorizontalResolution[] getSelfAndLowerDetails(EHorizontalResolution detail)
public static EMaxHorizontalResolution[] getSelfAndLowerDetails(EMaxHorizontalResolution detail)
{
if (lowerDetailArrays == null)
{
// run first time setup
lowerDetailArrays = new EHorizontalResolution[EHorizontalResolution.values().length][];
lowerDetailArrays = new EMaxHorizontalResolution[EMaxHorizontalResolution.values().length][];
// go through each LodDetail
for (EHorizontalResolution currentDetail : EHorizontalResolution.values())
for (EMaxHorizontalResolution currentDetail : EMaxHorizontalResolution.values())
{
ArrayList<EHorizontalResolution> lowerDetails = new ArrayList<>();
ArrayList<EMaxHorizontalResolution> lowerDetails = new ArrayList<>();
// find the details lower than currentDetail
for (EHorizontalResolution compareDetail : EHorizontalResolution.values())
for (EMaxHorizontalResolution compareDetail : EMaxHorizontalResolution.values())
{
if (currentDetail.detailLevel <= compareDetail.detailLevel)
{
@@ -153,7 +153,7 @@ public enum EHorizontalResolution
Collections.sort(lowerDetails);
Collections.reverse(lowerDetails);
lowerDetailArrays[currentDetail.detailLevel] = lowerDetails.toArray(new EHorizontalResolution[lowerDetails.size()]);
lowerDetailArrays[currentDetail.detailLevel] = lowerDetails.toArray(new EMaxHorizontalResolution[lowerDetails.size()]);
}
}
@@ -161,9 +161,9 @@ public enum EHorizontalResolution
}
/** Returns what detail level should be used at a given distance and maxDistance. */
public static EHorizontalResolution getDetailForDistance(EHorizontalResolution maxDetailLevel, int distance, int maxDistance)
public static EMaxHorizontalResolution getDetailForDistance(EMaxHorizontalResolution maxDetailLevel, int distance, int maxDistance)
{
EHorizontalResolution[] lowerDetails = getSelfAndLowerDetails(maxDetailLevel);
EMaxHorizontalResolution[] lowerDetails = getSelfAndLowerDetails(maxDetailLevel);
int distanceBetweenDetails = maxDistance / lowerDetails.length;
int index = MathUtil.clamp(0, distance / distanceBetweenDetails, lowerDetails.length - 1);
@@ -30,7 +30,7 @@ package com.seibel.lod.api.enums.rendering;
* @author James Seibel
* @version 2023-6-7
*/
public enum EDebugMode
public enum EDebugRendering
{
// Reminder:
// when adding items up the API minor version
@@ -53,7 +53,7 @@ public enum EDebugMode
SHOW_RENDER_SOURCE_FLAG;
public static EDebugMode next(EDebugMode type)
public static EDebugRendering next(EDebugRendering type)
{
switch (type)
{
@@ -65,7 +65,7 @@ public enum EDebugMode
}
}
public static EDebugMode previous(EDebugMode type)
public static EDebugRendering previous(EDebugRendering type)
{
switch (type)
{
@@ -1,25 +1,24 @@
package com.seibel.lod.api.interfaces.config;
import com.seibel.lod.api.interfaces.config.both.IDhApiWorldGenerationConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiBuffersConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiGraphicsConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiMultiplayerConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiThreadingConfig;
import com.seibel.lod.api.interfaces.config.client.*;
/**
* This interfaces holds all of the config groups
* the API has access to for easy access to all config values.
* This interfaces holds all config groups
* the API has access to for easy access.
*
* @author James Seibel
* @version 9-15-2022
* @version 2023-6-14
*/
public interface IDhApiConfig
{
IDhApiWorldGenerationConfig getWorldGeneratorConfig();
IDhApiBuffersConfig getBufferConfig();
IDhApiGraphicsConfig getGraphicsConfig();
IDhApiMultiplayerConfig getMultiplayerConfig();
IDhApiThreadingConfig getThreadingConfig();
IDhApiGraphicsConfig graphics();
IDhApiWorldGenerationConfig worldGenerator();
IDhApiMultiplayerConfig multiplayer();
IDhApiMultiThreadingConfig multiThreading();
IDhApiGpuBuffersConfig gpuBuffers();
// note: DON'T add the Auto Updater to this API. We only want the user's to have the ability to control when things are downloaded to their machines.
//IDhApiLoggingConfig logging(); // TODO implement
IDhApiDebuggingConfig debugging();
}
@@ -19,11 +19,9 @@
package com.seibel.lod.api.interfaces.config.both;
import com.seibel.lod.api.enums.config.EBlocksToAvoid;
import com.seibel.lod.api.enums.worldGeneration.EDhApiDistantGeneratorMode;
import com.seibel.lod.api.enums.config.EGenerationPriority;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.enums.config.ELightGenerationMode;
import com.seibel.lod.api.enums.worldGeneration.EDhApiDistantGeneratorMode;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
/**
@@ -41,31 +39,14 @@ public interface IDhApiWorldGenerationConfig extends IDhApiConfigGroup
* Defines whether fake chunks will be generated
* outside Minecraft's vanilla render distance.
*/
IDhApiConfigValue<Boolean> getEnableDistantWorldGeneration();
IDhApiConfigValue<Boolean> enableDistantWorldGeneration();
/** Defines to what level fake chunks will be generated. */
IDhApiConfigValue<EDhApiDistantGeneratorMode> getDistantGeneratorMode();
IDhApiConfigValue<EDhApiDistantGeneratorMode> distantGeneratorMode();
/**
* Defines what blocks will be ignored when generating LODs. <br><br>
*
* TODO if this isn't deprecated before 1.7 it should probably be moved to the graphics tab
* @deprecated this method won't be needed once we transition to an ID based save system <br>
* (vs the color based system we have currently)
/**
* TODO
*/
@Deprecated
IDhApiConfigValue<EBlocksToAvoid> getBlocksToAvoid();
/**
* Defines if the color of avoided blocks will color the block below them. <Br>
* (IE: if flowers are avoided should they color the grass below them?)
*
* TODO if this isn't deprecated before 1.7 it should probably be moved to the graphics tab
* @deprecated this method won't be needed once we transition to an ID based save system <br>
* (vs the color based system we have currently)
*/
@Deprecated
IDhApiConfigValue<Boolean> getTintWithAvoidedBlocks();
IDhApiConfigValue<ELightGenerationMode> lightingEngine();
}
@@ -19,7 +19,7 @@
package com.seibel.lod.api.interfaces.config.client;
import com.seibel.lod.api.enums.rendering.EDebugMode;
import com.seibel.lod.api.enums.rendering.EDebugRendering;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
@@ -32,10 +32,19 @@ import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
public interface IDhApiDebuggingConfig extends IDhApiConfigGroup
{
/** Can be used to debug the standard fake chunk rendering. */
IDhApiConfigValue<EDebugMode> getDebugRenderMode();
IDhApiConfigValue<EDebugRendering> debugRendering();
/** If enabled debug keybindings can be used. */
IDhApiConfigValue<Boolean> getEnableDebugKeybindings();
IDhApiConfigValue<Boolean> debugKeybindings();
/** TODO */
IDhApiConfigValue<Boolean> renderWireframe();
/** TODO */
IDhApiConfigValue<Boolean> lodOnlyMode();
/** TODO */
IDhApiConfigValue<Boolean> debugWireframeRendering();
}
@@ -0,0 +1,70 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.api.interfaces.config.client;
import com.seibel.lod.api.enums.rendering.*;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
/**
* Distant Horizons' fog configuration. <br><br>
*
* Note: unless an option explicitly states that it modifies
* Minecraft's vanilla rendering (like DisableVanillaFog)
* these settings will only affect Distant horizons' fog.
*
* @author James Seibel
* @version 2022-6-14
*/
public interface IDhApiFarFogConfig extends IDhApiConfigGroup
{
/**
* Defines where the fog starts as a percent of the
* fake chunks render distance radius. <br>
* Can be greater than the fog end distance to invert the fog direction. <br> <br>
*
* 0.0 = fog starts at the camera <br>
* 1.0 = fog starts at the edge of the fake chunk render distance <br>
*/
IDhApiConfigValue<Double> farFogStartDistance();
/**
* Defines where the fog ends as a percent of the radius
* of the fake chunks render distance. <br>
* Can be less than the fog start distance to invert the fog direction. <br> <br>
*
* 0.0 = fog ends at the camera <br>
* 1.0 = fog ends at the edge of the fake chunk render distance <br>
*/
IDhApiConfigValue<Double> farFogEndDistance();
/** Defines how opaque the fog is at its thinnest point. */
IDhApiConfigValue<Double> farFogMinThickness();
/** Defines how opaque the fog is at its thickest point. */
IDhApiConfigValue<Double> farFogMaxThickness();
/** Defines how the fog changes in thickness. */
IDhApiConfigValue<EFogFalloff> farFogFalloff();
/** Defines the fog density. */
IDhApiConfigValue<Double> farFogDensity();
}
@@ -0,0 +1,58 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.api.interfaces.config.client;
import com.seibel.lod.api.enums.rendering.*;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
/**
* Distant Horizons' fog configuration. <br><br>
*
* Note: unless an option explicitly states that it modifies
* Minecraft's vanilla rendering (like DisableVanillaFog)
* these settings will only affect Distant horizons' fog.
*
* @author James Seibel
* @version 2022-6-14
*/
public interface IDhApiFogConfig extends IDhApiConfigGroup
{
//====================//
// basic fog settings //
//====================//
/** Defines at what distance fog is rendered on fake chunks. */
IDhApiConfigValue<EFogDistance> distance();
/** Should be used to enable/disable fog rendering. */
IDhApiConfigValue<EFogDrawMode> drawMode();
/** Can be used to enable support with mods that change vanilla MC's fog color. */
IDhApiConfigValue<EFogColorMode> color();
/**
* If enabled attempts to disable vanilla MC's fog on real chunks. <br>
* May not play nice with other fog editing mods.
*/
IDhApiConfigValue<Boolean> disableVanillaFog();
}
@@ -27,13 +27,13 @@ import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
* Distant Horizons' OpenGL buffer configuration.
*
* @author James Seibel
* @version 2022-9-15
* @version 2023-6-14
*/
public interface IDhApiBuffersConfig extends IDhApiConfigGroup
public interface IDhApiGpuBuffersConfig extends IDhApiConfigGroup
{
/** Defines how geometry data is uploaded to the GPU. */
IDhApiConfigValue<EGpuUploadMethod> getGpuUploadMethod();
IDhApiConfigValue<EGpuUploadMethod> gpuUploadMethod();
/**
* Defines how long we should wait after uploading one
@@ -42,6 +42,6 @@ public interface IDhApiBuffersConfig extends IDhApiConfigGroup
* This can be set to a non-zero number to reduce stuttering caused by
* uploading buffers to the GPU.
*/
IDhApiConfigValue<Integer> getBufferUploadTimeoutPerMegabyteInMilliseconds();
IDhApiConfigValue<Integer> gpuUploadPerMegabyteInMilliseconds();
}
@@ -21,6 +21,7 @@ package com.seibel.lod.api.interfaces.config.client;
import com.seibel.lod.api.enums.config.*;
import com.seibel.lod.api.enums.rendering.ERendererMode;
import com.seibel.lod.api.enums.rendering.ETransparency;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
@@ -28,25 +29,33 @@ import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
* Distant Horizons' graphics/rendering configuration.
*
* @author James Seibel
* @version 2022-9-15
* @version 2023-6-14
*/
public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
{
//===============//
// inner configs //
//===============//
IDhApiFogConfig fog();
IDhApiNoiseTextureConfig noiseTexture();
//========================//
// basic graphic settings //
//========================//
/** The distance is the radius measured in chunks. */
IDhApiConfigValue<Integer> getChunkRenderDistance();
IDhApiConfigValue<Integer> chunkRenderDistance();
/**
* Simplified version of {@link IDhApiGraphicsConfig#getRenderingMode()}
* Simplified version of {@link IDhApiGraphicsConfig#renderingMode()}
* that only enables/disables the fake chunk rendering. <br><br>
*
* Changing this config also changes {@link IDhApiGraphicsConfig#getRenderingMode()}'s value.
* Changing this config also changes {@link IDhApiGraphicsConfig#renderingMode()}'s value.
*/
IDhApiConfigValue<Boolean> getRenderingEnabled();
IDhApiConfigValue<Boolean> renderingEnabled();
/**
* Can be used to enable/disable fake chunk rendering or enable the debug renderer. <br><br>
@@ -54,9 +63,9 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
* The debug renderer is used to confirm rendering is working at and will draw
* a single multicolor rhombus on the screen in skybox space (AKA behind MC's rendering). <br><br>
*
* Changing this config also changes {@link IDhApiGraphicsConfig#getRenderingEnabled()}'s value.
* Changing this config also changes {@link IDhApiGraphicsConfig#renderingEnabled()}'s value.
*/
IDhApiConfigValue<ERendererMode> getRenderingMode();
IDhApiConfigValue<ERendererMode> renderingMode();
@@ -65,14 +74,27 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
//==================//
/** Defines how detailed fake chunks are in the horizontal direction */
IDhApiConfigValue<EHorizontalResolution> getMaxDetailLevel();
IDhApiConfigValue<EMaxHorizontalResolution> maxHorizontalResolution();
/** Defines how detailed fake chunks are in the vertical direction */
IDhApiConfigValue<EVerticalQuality> getVerticalQuality();
IDhApiConfigValue<EVerticalQuality> verticalQuality();
/** Modifies the quadratic function fake chunks use for horizontal quality drop-off. */
IDhApiConfigValue<EHorizontalQuality> getHorizontalQualityDropoff();
IDhApiConfigValue<EHorizontalQuality> horizontalQuality();
IDhApiConfigValue<Boolean> ambientOcclusion();
IDhApiConfigValue<ETransparency> transparency();
/** Defines what blocks won't be rendered as LODs. */
IDhApiConfigValue<EBlocksToAvoid> blocksToAvoid();
/**
* Defines if the color of avoided blocks will color the block below them. <Br>
* (IE: if flowers are avoided, should they color the grass below them?)
*/
IDhApiConfigValue<Boolean> tintWithAvoidedBlocks();
/**
* The same as vanilla Minecraft's biome blending. <br><br>
*
@@ -95,32 +117,35 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
* Disabling this reduces holes in the world due to the near clip plane
* being too close to the camera and the terrain not being covered by vanilla terrain.
*/
IDhApiConfigValue<Boolean> getUseExtendedNearClipPlane();
IDhApiConfigValue<EOverdrawPrevention> overdrawPrevention();
/**
* Modifies how bright fake chunks are. <br>
* This is done when generating the vertex data and is applied before any shaders.
*/
IDhApiConfigValue<Double> getBrightnessMultiplier();
IDhApiConfigValue<Double> brightnessMultiplier();
/**
* Modifies how saturated fake chunks are. <br>
* This is done when generating the vertex data and is applied before any shaders.
*/
IDhApiConfigValue<Double> getSaturationMultiplier();
IDhApiConfigValue<Double> saturationMultiplier();
/** Defines if Distant Horizons should attempt to cull fake chunk cave geometry. */
IDhApiConfigValue<Boolean> getCaveCullingEnabled();
IDhApiConfigValue<Boolean> caveCullingEnabled();
/** Defines what height cave culling should be used below if enabled. */
IDhApiConfigValue<Integer> getCaveCullingHeight();
IDhApiConfigValue<Integer> caveCullingHeight();
/** This ratio is relative to Earth's real world curvature. */
IDhApiConfigValue<Integer> getEarthCurvatureRatio();
IDhApiConfigValue<Integer> earthCurvatureRatio();
/** If enabled vanilla chunk rendering is disabled and only fake chunks are rendered. */
IDhApiConfigValue<Boolean> getEnableLodOnlyMode();
IDhApiConfigValue<Boolean> lodOnlyMode();
/**
* TODO
*/
IDhApiConfigValue<Double> lodBias();
}
@@ -1,130 +0,0 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.api.interfaces.config.client;
import com.seibel.lod.api.enums.rendering.*;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
/**
* Distant Horizons' fog configuration. <br><br>
*
* Note: unless an option explicitly states that it modifies
* Minecraft's vanilla rendering (like DisableVanillaFog)
* these settings will only affect Distant horizons' fog.
*
* @author James Seibel
* @version 2022-9-15
*/
public interface IDhApiGraphicsFogConfig extends IDhApiConfigGroup
{
//====================//
// basic fog settings //
//====================//
/** Defines at what distance fog is rendered on fake chunks. */
IDhApiConfigValue<EFogDistance> getFogDistance();
/** Should be used to enable/disable fog rendering. */
IDhApiConfigValue<EFogDrawMode> getFogRender();
/** Can be used to enable support with mods that change vanilla MC's fog color. */
IDhApiConfigValue<EFogColorMode> getFogColor();
/**
* If enabled attempts to disable vanilla MC's fog on real chunks. <br>
* May not play nice with other fog editing mods.
*/
IDhApiConfigValue<Boolean> getDisableVanillaFog();
//=======================//
// advanced fog settings //
//=======================//
/**
* Defines where the fog starts as a percent of the
* fake chunks render distance radius. <br>
* Can be greater than the fog end distance to invert the fog direction. <br> <br>
*
* 0.0 = fog starts at the camera <br>
* 1.0 = fog starts at the edge of the fake chunk render distance <br>
*/
IDhApiConfigValue<Double> getFogStartDistance();
/**
* Defines where the fog ends as a percent of the radius
* of the fake chunks render distance. <br>
* Can be less than the fog start distance to invert the fog direction. <br> <br>
*
* 0.0 = fog ends at the camera <br>
* 1.0 = fog ends at the edge of the fake chunk render distance <br>
*/
IDhApiConfigValue<Double> getFogEndDistance();
/** Defines how opaque the fog is at its thinnest point. */
IDhApiConfigValue<Double> getFogMinThickness();
/** Defines how opaque the fog is at its thickest point. */
IDhApiConfigValue<Double> getFogMaxThickness();
/** Defines how the fog changes in thickness. */
IDhApiConfigValue<EFogFalloff> getFarFogFalloff();
/** Defines the fog density. */
IDhApiConfigValue<Double> getFogDensity();
//=====================//
// height fog settings //
//=====================//
/** Defines how the height fog mixes. */
IDhApiConfigValue<EHeightFogMixMode> getHeightFogMixMode();
/** Defines how the height fog is drawn relative to the camera or world. */
IDhApiConfigValue<EHeightFogMode> getHeightFogMode();
/**
* Defines the height fog's base height if {@link IDhApiGraphicsFogConfig#getHeightFogMode()}
* is set to use a specific height.
*/
IDhApiConfigValue<Double> getHeightFogBaseHeight();
/** Defines the height fog's starting height as a percent of the world height. */
IDhApiConfigValue<Double> getHeightFogStartingHeightPercent();
/** Defines the height fog's ending height as a percent of the world height. */
IDhApiConfigValue<Double> getHeightFogEndingHeightPercent();
/** Defines how opaque the height fog is at its thinnest point. */
IDhApiConfigValue<Double> getHeightFogMinThickness();
/** Defines how opaque the height fog is at its thickest point. */
IDhApiConfigValue<Double> getHeightFogMaxThickness();
/** Defines how the height fog changes in thickness. */
IDhApiConfigValue<EFogFalloff> getHeightFogFalloff();
/** Defines the height fog's density. */
IDhApiConfigValue<Double> getHeightFogDensity();
}
@@ -0,0 +1,71 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.api.interfaces.config.client;
import com.seibel.lod.api.enums.rendering.EFogFalloff;
import com.seibel.lod.api.enums.rendering.EHeightFogMixMode;
import com.seibel.lod.api.enums.rendering.EHeightFogMode;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
/**
* Distant Horizons' fog configuration. <br><br>
*
* Note: unless an option explicitly states that it modifies
* Minecraft's vanilla rendering (like DisableVanillaFog)
* these settings will only affect Distant horizons' fog.
*
* @author James Seibel
* @version 2022-6-14
*/
public interface IDhApiHeightFogConfig extends IDhApiConfigGroup
{
/** Defines how the height fog mixes. */
IDhApiConfigValue<EHeightFogMixMode> heightFogMixMode();
/** Defines how the height fog is drawn relative to the camera or world. */
IDhApiConfigValue<EHeightFogMode> heightFogMode();
/**
* Defines the height fog's base height if {@link IDhApiHeightFogConfig#heightFogMode()}
* is set to use a specific height.
*/
IDhApiConfigValue<Double> heightFogBaseHeight();
/** Defines the height fog's starting height as a percent of the world height. */
IDhApiConfigValue<Double> heightFogStartingHeightPercent();
/** Defines the height fog's ending height as a percent of the world height. */
IDhApiConfigValue<Double> heightFogEndingHeightPercent();
/** Defines how opaque the height fog is at its thinnest point. */
IDhApiConfigValue<Double> heightFogMinThickness();
/** Defines how opaque the height fog is at its thickest point. */
IDhApiConfigValue<Double> heightFogMaxThickness();
/** Defines how the height fog changes in thickness. */
IDhApiConfigValue<EFogFalloff> heightFogFalloff();
/** Defines the height fog's density. */
IDhApiConfigValue<Double> heightFogDensity();
}
@@ -0,0 +1,37 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.api.interfaces.config.client;
import com.seibel.lod.api.enums.rendering.EFogColorMode;
import com.seibel.lod.api.enums.rendering.EFogDistance;
import com.seibel.lod.api.enums.rendering.EFogDrawMode;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
/**
* Distant Horizons' fog configuration. <br><br>
*
* @author James Seibel
* @version 2022-6-14
*/
public interface IDhApiLoggingConfig extends IDhApiConfigGroup
{
// TODO implement
}
@@ -26,9 +26,9 @@ import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
* Distant Horizons' threading configuration.
*
* @author James Seibel
* @version 2023-6-5
* @version 2023-6-14
*/
public interface IDhApiThreadingConfig extends IDhApiConfigGroup
public interface IDhApiMultiThreadingConfig extends IDhApiConfigGroup
{
/**
@@ -36,19 +36,15 @@ public interface IDhApiThreadingConfig extends IDhApiConfigGroup
* terrain outside Minecraft's vanilla render distance. <br>
* <br>
* If the number of threads is less than 1 it will be treated as a percentage
* representing how often the single thread will actively generate terrain. <br> <br>
*
* @deprecated this (and the related config) should be replaced with an int
* count of threads and then a double percent active config.
* representing how often the single thread will actively generate terrain.
*/
@Deprecated
IDhApiConfigValue<Integer> getWorldGeneratorThread();
IDhApiConfigValue<Integer> worldGeneratorThreads();
/** Defines how many buffer (GPU Terrain data) builder threads are used. */
IDhApiConfigValue<Integer> getBufferBuilderThread();
IDhApiConfigValue<Integer> bufferBuilderThreads();
/** Defines how many file handler threads are used. */
IDhApiConfigValue<Integer> getFileHandlerThread();
IDhApiConfigValue<Integer> fileHandlerThreads();
/**
* Defines how many Full to Render data converter threads are used. <br><br>
@@ -56,6 +52,11 @@ public interface IDhApiThreadingConfig extends IDhApiConfigGroup
* <strong>Full data</strong> - Distant Horizons data based on BlockState and Biome IDs <br>
* <strong>Render data</strong> - color data used when Distant Horizons is rendering
*/
IDhApiConfigValue<Integer> getDataConverterThread();
IDhApiConfigValue<Integer> dataConverterThreads();
/**
* TODO
*/
IDhApiConfigValue<Integer> chunkLodConverterThreads();
}
@@ -27,7 +27,7 @@ import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
* Distant Horizons' client-side multiplayer configuration.
*
* @author James Seibel
* @version 2022-9-15
* @version 2023-6-14
*/
public interface IDhApiMultiplayerConfig extends IDhApiConfigGroup
{
@@ -36,7 +36,7 @@ public interface IDhApiMultiplayerConfig extends IDhApiConfigGroup
* Defines how multiplayer server folders are named. <br>
* Note: Changing this while connected to a multiplayer world will cause undefined behavior!
*/
IDhApiConfigValue<EServerFolderNameMode> getFolderSavingMode();
IDhApiConfigValue<EServerFolderNameMode> folderSavingMode();
/**
* Defines the necessary similarity (as a percent) that two potential levels
@@ -47,7 +47,7 @@ public interface IDhApiMultiplayerConfig extends IDhApiConfigGroup
* Setting this to a non-zero value allows for usage in servers that user Multiverse
* or similar mods.
*/
IDhApiConfigValue<Double> getMultiverseSimilarityRequirement();
IDhApiConfigValue<Double> multiverseSimilarityRequirement();
}
@@ -0,0 +1,53 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.api.interfaces.config.client;
import com.seibel.lod.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
/**
* Distant Horizons' noise texture configuration. <br><br>
*
* @author James Seibel
* @version 2022-6-14
*/
public interface IDhApiNoiseTextureConfig extends IDhApiConfigGroup
{
/**
* TODO
*/
IDhApiConfigValue<Boolean> noiseEnabled();
/**
* TODO
*/
IDhApiConfigValue<Integer> noiseSteps();
/**
* TODO
*/
IDhApiConfigValue<Double> noiseIntensity();
/**
* TODO
*/
IDhApiConfigValue<Double> noiseDropoff();
}
@@ -2,22 +2,10 @@ package com.seibel.lod.core.api.external.methods.config;
import com.seibel.lod.api.interfaces.config.IDhApiConfig;
import com.seibel.lod.api.interfaces.config.both.IDhApiWorldGenerationConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiBuffersConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiGraphicsConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiMultiplayerConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiThreadingConfig;
import com.seibel.lod.core.api.external.methods.config.both.DhApiWorldGenerationConfig;
import com.seibel.lod.core.api.external.methods.config.client.DhApiBuffersConfig;
import com.seibel.lod.core.api.external.methods.config.client.DhApiGraphicsConfig;
import com.seibel.lod.core.api.external.methods.config.client.DhApiMultiplayerConfig;
import com.seibel.lod.core.api.external.methods.config.client.DhApiThreadingConfig;
import com.seibel.lod.api.interfaces.config.client.*;
import com.seibel.lod.core.api.external.methods.config.client.*;
import com.seibel.lod.core.api.external.methods.config.common.DhApiWorldGenerationConfig;
/**
* A singleton that holds all of the config groups for the API.
*
* @author James Seibel
* @version 9-15-2022
*/
public class DhApiConfig implements IDhApiConfig
{
public static final DhApiConfig INSTANCE = new DhApiConfig();
@@ -25,15 +13,18 @@ public class DhApiConfig implements IDhApiConfig
private DhApiConfig() { }
@Override
public IDhApiGraphicsConfig graphics() { return DhApiGraphicsConfig.INSTANCE; }
@Override
public IDhApiWorldGenerationConfig getWorldGeneratorConfig() { return DhApiWorldGenerationConfig.INSTANCE; }
public IDhApiWorldGenerationConfig worldGenerator() { return DhApiWorldGenerationConfig.INSTANCE; }
@Override
public IDhApiMultiplayerConfig multiplayer() { return DhApiMultiplayerConfig.INSTANCE; }
@Override
public IDhApiMultiThreadingConfig multiThreading() { return DhApiMultiThreadingConfig.INSTANCE; }
@Override
public IDhApiBuffersConfig getBufferConfig() { return DhApiBuffersConfig.INSTANCE; }
public IDhApiGpuBuffersConfig gpuBuffers() { return DhApiGpuBuffersConfig.INSTANCE; }
@Override
public IDhApiGraphicsConfig getGraphicsConfig() { return DhApiGraphicsConfig.INSTANCE; }
@Override
public IDhApiMultiplayerConfig getMultiplayerConfig() { return DhApiMultiplayerConfig.INSTANCE; }
@Override
public IDhApiThreadingConfig getThreadingConfig() { return DhApiThreadingConfig.INSTANCE; }
public IDhApiDebuggingConfig debugging() { return DhApiDebuggingConfig.INSTANCE; }
}
@@ -23,14 +23,8 @@ import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.interfaces.config.client.IDhApiDebuggingConfig;
import com.seibel.lod.api.objects.config.DhApiConfigValue;
import com.seibel.lod.core.config.Config.Client.Advanced.Debugging;
import com.seibel.lod.api.enums.rendering.EDebugMode;
import com.seibel.lod.api.enums.rendering.EDebugRendering;
/**
* Distant Horizons' debug configuration.
*
* @author James Seibel
* @version 2022-9-15
*/
public class DhApiDebuggingConfig implements IDhApiDebuggingConfig
{
public static DhApiDebuggingConfig INSTANCE = new DhApiDebuggingConfig();
@@ -39,10 +33,19 @@ public class DhApiDebuggingConfig implements IDhApiDebuggingConfig
public IDhApiConfigValue<EDebugMode> getDebugRenderMode()
{ return new DhApiConfigValue<>(Debugging.debugMode); }
public IDhApiConfigValue<EDebugRendering> debugRendering()
{ return new DhApiConfigValue<EDebugRendering, EDebugRendering>(Debugging.debugRendering); }
public IDhApiConfigValue<Boolean> getEnableDebugKeybindings()
{ return new DhApiConfigValue<>(Debugging.enableDebugKeybindings); }
public IDhApiConfigValue<Boolean> debugKeybindings()
{ return new DhApiConfigValue<Boolean, Boolean>(Debugging.enableDebugKeybindings); }
public IDhApiConfigValue<Boolean> renderWireframe()
{ return new DhApiConfigValue<Boolean, Boolean>(Debugging.renderWireframe); }
public IDhApiConfigValue<Boolean> lodOnlyMode()
{ return new DhApiConfigValue<Boolean, Boolean>(Debugging.lodOnlyMode); }
public IDhApiConfigValue<Boolean> debugWireframeRendering()
{ return new DhApiConfigValue<Boolean, Boolean>(Debugging.debugWireframeRendering); }
}
@@ -0,0 +1,61 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.core.api.external.methods.config.client;
import com.seibel.lod.api.enums.rendering.*;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.interfaces.config.client.IDhApiFarFogConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiFogConfig;
import com.seibel.lod.api.objects.config.DhApiConfigValue;
import com.seibel.lod.core.config.Config.Client.Advanced.Graphics.Fog;
public class DhApiFarFogConfig implements IDhApiFarFogConfig
{
public static DhApiFarFogConfig INSTANCE = new DhApiFarFogConfig();
private DhApiFarFogConfig() { }
@Override
public IDhApiConfigValue<Double> farFogStartDistance()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.farFogStart); }
@Override
public IDhApiConfigValue<Double> farFogEndDistance()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.farFogEnd); }
@Override
public IDhApiConfigValue<Double> farFogMinThickness()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.farFogMin); }
@Override
public IDhApiConfigValue<Double> farFogMaxThickness()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.farFogMax); }
@Override
public IDhApiConfigValue<EFogFalloff> farFogFalloff()
{ return new DhApiConfigValue<EFogFalloff, EFogFalloff>(Fog.AdvancedFog.farFogFalloff); }
@Override
public IDhApiConfigValue<Double> farFogDensity()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.farFogDensity); }
}
@@ -0,0 +1,67 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.core.api.external.methods.config.client;
import com.seibel.lod.api.enums.rendering.*;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.interfaces.config.client.IDhApiFarFogConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiFogConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiHeightFogConfig;
import com.seibel.lod.api.objects.config.DhApiConfigValue;
import com.seibel.lod.core.config.Config.Client.Advanced.Graphics.Fog;
public class DhApiFogConfig implements IDhApiFogConfig
{
public static DhApiFogConfig INSTANCE = new DhApiFogConfig();
private DhApiFogConfig() { }
//===============//
// inner configs //
//===============//
public IDhApiFarFogConfig farFog() { return DhApiFarFogConfig.INSTANCE; }
public IDhApiHeightFogConfig heightFog() { return DhApiHeightFogConfig.INSTANCE; }
//====================//
// basic fog settings //
//====================//
@Override
public IDhApiConfigValue<EFogDistance> distance()
{ return new DhApiConfigValue<>(Fog.distance); }
@Override
public IDhApiConfigValue<EFogDrawMode> drawMode()
{ return new DhApiConfigValue<>(Fog.drawMode); }
@Override
public IDhApiConfigValue<EFogColorMode> color()
{ return new DhApiConfigValue<>(Fog.colorMode); }
@Override
public IDhApiConfigValue<Boolean> disableVanillaFog()
{ return new DhApiConfigValue<>(Fog.disableVanillaFog); }
}
@@ -20,30 +20,24 @@
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.interfaces.config.client.IDhApiGpuBuffersConfig;
import com.seibel.lod.api.objects.config.DhApiConfigValue;
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;
/**
* Distant Horizons' OpenGL buffer configuration.
*
* @author James Seibel
* @version 2022-9-15
*/
public class DhApiBuffersConfig implements IDhApiBuffersConfig
public class DhApiGpuBuffersConfig implements IDhApiGpuBuffersConfig
{
public static DhApiBuffersConfig INSTANCE = new DhApiBuffersConfig();
public static DhApiGpuBuffersConfig INSTANCE = new DhApiGpuBuffersConfig();
private DhApiBuffersConfig() { }
private DhApiGpuBuffersConfig() { }
public IDhApiConfigValue<EGpuUploadMethod> getGpuUploadMethod()
public IDhApiConfigValue<EGpuUploadMethod> gpuUploadMethod()
{ return new DhApiConfigValue<>(Config.Client.Advanced.GpuBuffers.gpuUploadMethod); }
public IDhApiConfigValue<Integer> getBufferUploadTimeoutPerMegabyteInMilliseconds()
public IDhApiConfigValue<Integer> gpuUploadPerMegabyteInMilliseconds()
{ return new DhApiConfigValue<>(GpuBuffers.gpuUploadPerMegabyteInMilliseconds); }
}
@@ -20,21 +20,18 @@
package com.seibel.lod.core.api.external.methods.config.client;
import com.seibel.lod.api.enums.config.*;
import com.seibel.lod.api.enums.rendering.ETransparency;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.interfaces.config.client.IDhApiFogConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiGraphicsConfig;
import com.seibel.lod.api.interfaces.config.client.IDhApiNoiseTextureConfig;
import com.seibel.lod.api.objects.config.DhApiConfigValue;
import com.seibel.lod.coreapi.util.converters.RenderModeEnabledConverter;
import com.seibel.lod.api.enums.rendering.ERendererMode;
import com.seibel.lod.core.config.Config;
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.Advanced.Graphics.AdvancedGraphics;
/**
* Distant Horizons' graphics/rendering configuration.
*
* @author James Seibel
* @version 2022-9-15
*/
public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
{
public static DhApiGraphicsConfig INSTANCE = new DhApiGraphicsConfig();
@@ -43,21 +40,30 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
//==============//
// inner layers //
//==============//
public IDhApiFogConfig fog() { return DhApiFogConfig.INSTANCE; }
public IDhApiNoiseTextureConfig noiseTexture() { return DhApiNoiseTextureConfig.INSTANCE; }
//========================//
// basic graphic settings //
//========================//
@Override
public IDhApiConfigValue<Integer> getChunkRenderDistance()
{ return new DhApiConfigValue<>(Quality.lodChunkRenderDistance); }
public IDhApiConfigValue<Integer> chunkRenderDistance()
{ return new DhApiConfigValue<Integer, Integer>(Quality.lodChunkRenderDistance); }
@Override
public IDhApiConfigValue<Boolean> getRenderingEnabled()
{ return new DhApiConfigValue<ERendererMode, Boolean>(Debugging.rendererMode, new RenderModeEnabledConverter()); }
public IDhApiConfigValue<Boolean> renderingEnabled()
{ return new DhApiConfigValue<Boolean, Boolean>(Config.Client.quickEnableRendering); }
@Override
public IDhApiConfigValue<ERendererMode> getRenderingMode()
{ return new DhApiConfigValue<>(Debugging.rendererMode); }
public IDhApiConfigValue<ERendererMode> renderingMode()
{ return new DhApiConfigValue<ERendererMode, ERendererMode>(Debugging.rendererMode); }
@@ -66,20 +72,37 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
//==================//
@Override
public IDhApiConfigValue<EHorizontalResolution> getMaxDetailLevel()
{ return new DhApiConfigValue<>(Quality.drawResolution); }
public IDhApiConfigValue<EMaxHorizontalResolution> maxHorizontalResolution()
{ return new DhApiConfigValue<EMaxHorizontalResolution, EMaxHorizontalResolution>(Quality.maxHorizontalResolution); }
@Override
public IDhApiConfigValue<EVerticalQuality> getVerticalQuality()
{ return new DhApiConfigValue<>(Quality.verticalQuality); }
public IDhApiConfigValue<EVerticalQuality> verticalQuality()
{ return new DhApiConfigValue<EVerticalQuality, EVerticalQuality>(Quality.verticalQuality); }
@Override
public IDhApiConfigValue<EHorizontalQuality> getHorizontalQualityDropoff()
{ return new DhApiConfigValue<>(Quality.horizontalQuality); }
public IDhApiConfigValue<EHorizontalQuality> horizontalQuality()
{ return new DhApiConfigValue<EHorizontalQuality, EHorizontalQuality>(Quality.horizontalQuality); }
@Override
public IDhApiConfigValue<Boolean> ambientOcclusion()
{ return new DhApiConfigValue<Boolean, Boolean>(Quality.ssao); }
@Override
public IDhApiConfigValue<ETransparency> transparency()
{ return new DhApiConfigValue<ETransparency, ETransparency>(Quality.transparency); }
@Override
public IDhApiConfigValue<EBlocksToAvoid> blocksToAvoid()
{ return new DhApiConfigValue<EBlocksToAvoid, EBlocksToAvoid>(Quality.blocksToIgnore); }
@Override
public IDhApiConfigValue<Boolean> tintWithAvoidedBlocks()
{ return new DhApiConfigValue<Boolean, Boolean>(Quality.tintWithAvoidedBlocks); }
// TODO re-implement
// @Override
// public IDhApiConfigValue<Integer> getBiomeBlending()
// { return new DhApiConfigValue<>(Quality.lodBiomeBlending); }
// { return new DhApiConfigValue<Integer, Integer>(Quality.lodBiomeBlending); }
@@ -89,35 +112,39 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
// @Override
// public IDhApiConfigValue<Boolean> getDisableDirectionalCulling()
// { return new DhApiConfigValue<>(AdvancedGraphics.disableDirectionalCulling); }
// { return new DhApiConfigValue<Boolean, Boolean>(AdvancedGraphics.disableDirectionalCulling); }
@Override
public IDhApiConfigValue<Boolean> getUseExtendedNearClipPlane()
{ return new DhApiConfigValue<>(AdvancedGraphics.overdrawPrevention); }
public IDhApiConfigValue<EOverdrawPrevention> overdrawPrevention()
{ return new DhApiConfigValue<EOverdrawPrevention, EOverdrawPrevention>(AdvancedGraphics.overdrawPrevention); }
@Override
public IDhApiConfigValue<Double> getBrightnessMultiplier()
{ return new DhApiConfigValue<>(AdvancedGraphics.brightnessMultiplier); }
public IDhApiConfigValue<Double> brightnessMultiplier()
{ return new DhApiConfigValue<Double, Double>(AdvancedGraphics.brightnessMultiplier); }
@Override
public IDhApiConfigValue<Double> getSaturationMultiplier()
{ return new DhApiConfigValue<>(AdvancedGraphics.saturationMultiplier); }
public IDhApiConfigValue<Double> saturationMultiplier()
{ return new DhApiConfigValue<Double, Double>(AdvancedGraphics.saturationMultiplier); }
@Override
public IDhApiConfigValue<Boolean> getCaveCullingEnabled()
{ return new DhApiConfigValue<>(AdvancedGraphics.enableCaveCulling); }
public IDhApiConfigValue<Boolean> caveCullingEnabled()
{ return new DhApiConfigValue<Boolean, Boolean>(AdvancedGraphics.enableCaveCulling); }
@Override
public IDhApiConfigValue<Integer> getCaveCullingHeight()
{ return new DhApiConfigValue<>(AdvancedGraphics.caveCullingHeight); }
public IDhApiConfigValue<Integer> caveCullingHeight()
{ return new DhApiConfigValue<Integer, Integer>(AdvancedGraphics.caveCullingHeight); }
@Override
public IDhApiConfigValue<Integer> getEarthCurvatureRatio()
{ return new DhApiConfigValue<>(AdvancedGraphics.earthCurveRatio); }
public IDhApiConfigValue<Integer> earthCurvatureRatio()
{ return new DhApiConfigValue<Integer, Integer>(AdvancedGraphics.earthCurveRatio); }
@Override
public IDhApiConfigValue<Boolean> getEnableLodOnlyMode()
{ return new DhApiConfigValue<>(Debugging.lodOnlyMode); }
public IDhApiConfigValue<Boolean> lodOnlyMode()
{ return new DhApiConfigValue<Boolean, Boolean>(Debugging.lodOnlyMode); }
@Override
public IDhApiConfigValue<Double> lodBias()
{ return new DhApiConfigValue<Double, Double>(AdvancedGraphics.lodBias); }
@@ -1,136 +0,0 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.core.api.external.methods.config.client;
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.Advanced.Graphics.Fog;
/**
* Distant Horizons' fog configuration. <br><br>
*
* Note: unless an option explicitly states that it modifies
* Minecraft's vanilla rendering (like DisableVanillaFog)
* these settings will only affect Distant horizons' fog.
*
* @author James Seibel
* @version 2022-9-15
*/
public class DhApiGraphicsFogConfig implements IDhApiGraphicsFogConfig
{
public static DhApiGraphicsFogConfig INSTANCE = new DhApiGraphicsFogConfig();
private DhApiGraphicsFogConfig() { }
//====================//
// basic fog settings //
//====================//
@Override
public IDhApiConfigValue<EFogDistance> getFogDistance()
{ return new DhApiConfigValue<>(Fog.fogDistance); }
@Override
public IDhApiConfigValue<EFogDrawMode> getFogRender()
{ return new DhApiConfigValue<>(Fog.fogDrawMode); }
@Override
public IDhApiConfigValue<EFogColorMode> getFogColor()
{ return new DhApiConfigValue<>(Fog.fogColorMode); }
@Override
public IDhApiConfigValue<Boolean> getDisableVanillaFog()
{ return new DhApiConfigValue<>(Fog.disableVanillaFog); }
//=======================//
// advanced fog settings //
//=======================//
@Override
public IDhApiConfigValue<Double> getFogStartDistance()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.farFogStart); }
@Override
public IDhApiConfigValue<Double> getFogEndDistance()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.farFogEnd); }
@Override
public IDhApiConfigValue<Double> getFogMinThickness()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.farFogMin); }
@Override
public IDhApiConfigValue<Double> getFogMaxThickness()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.farFogMax); }
@Override
public IDhApiConfigValue<EFogFalloff> getFarFogFalloff()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.farFogFalloff); }
@Override
public IDhApiConfigValue<Double> getFogDensity()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.farFogDensity); }
//=====================//
// height fog settings //
//=====================//
@Override
public IDhApiConfigValue<EHeightFogMixMode> getHeightFogMixMode()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogMixMode); }
@Override
public IDhApiConfigValue<EHeightFogMode> getHeightFogMode()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogMode); }
@Override
public IDhApiConfigValue<Double> getHeightFogBaseHeight()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogHeight); }
@Override
public IDhApiConfigValue<Double> getHeightFogStartingHeightPercent()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogStart); }
@Override
public IDhApiConfigValue<Double> getHeightFogEndingHeightPercent()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogEnd); }
@Override
public IDhApiConfigValue<Double> getHeightFogMinThickness()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogMin); }
@Override
public IDhApiConfigValue<Double> getHeightFogMaxThickness()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogMax); }
@Override
public IDhApiConfigValue<EFogFalloff> getHeightFogFalloff()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogFalloff); }
@Override
public IDhApiConfigValue<Double> getHeightFogDensity()
{ return new DhApiConfigValue<>(Fog.AdvancedFog.HeightFog.heightFogDensity); }
}
@@ -0,0 +1,72 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.core.api.external.methods.config.client;
import com.seibel.lod.api.enums.rendering.*;
import com.seibel.lod.api.interfaces.config.IDhApiConfigValue;
import com.seibel.lod.api.interfaces.config.client.IDhApiHeightFogConfig;
import com.seibel.lod.api.objects.config.DhApiConfigValue;
import com.seibel.lod.core.config.Config.Client.Advanced.Graphics.Fog;
public class DhApiHeightFogConfig implements IDhApiHeightFogConfig
{
public static DhApiHeightFogConfig INSTANCE = new DhApiHeightFogConfig();
private DhApiHeightFogConfig() { }
@Override
public IDhApiConfigValue<EHeightFogMixMode> heightFogMixMode()
{ return new DhApiConfigValue<EHeightFogMixMode, EHeightFogMixMode>(Fog.AdvancedFog.HeightFog.heightFogMixMode); }
@Override
public IDhApiConfigValue<EHeightFogMode> heightFogMode()
{ return new DhApiConfigValue<EHeightFogMode, EHeightFogMode>(Fog.AdvancedFog.HeightFog.heightFogMode); }
@Override
public IDhApiConfigValue<Double> heightFogBaseHeight()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.HeightFog.heightFogBaseHeight); }
@Override
public IDhApiConfigValue<Double> heightFogStartingHeightPercent()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.HeightFog.heightFogStart); }
@Override
public IDhApiConfigValue<Double> heightFogEndingHeightPercent()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.HeightFog.heightFogEnd); }
@Override
public IDhApiConfigValue<Double> heightFogMinThickness()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.HeightFog.heightFogMin); }
@Override
public IDhApiConfigValue<Double> heightFogMaxThickness()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.HeightFog.heightFogMax); }
@Override
public IDhApiConfigValue<EFogFalloff> heightFogFalloff()
{ return new DhApiConfigValue<EFogFalloff, EFogFalloff>(Fog.AdvancedFog.HeightFog.heightFogFalloff); }
@Override
public IDhApiConfigValue<Double> heightFogDensity()
{ return new DhApiConfigValue<Double, Double>(Fog.AdvancedFog.HeightFog.heightFogDensity); }
}
@@ -0,0 +1,55 @@
/*
* 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 <https://www.gnu.org/licenses/>.
*/
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.IDhApiMultiThreadingConfig;
import com.seibel.lod.api.objects.config.DhApiConfigValue;
import com.seibel.lod.core.config.Config.Client.Advanced.MultiThreading;
public class DhApiMultiThreadingConfig implements IDhApiMultiThreadingConfig
{
public static DhApiMultiThreadingConfig INSTANCE = new DhApiMultiThreadingConfig();
private DhApiMultiThreadingConfig() { }
@Override
public IDhApiConfigValue<Integer> worldGeneratorThreads()
{ return new DhApiConfigValue<Integer, Integer>(MultiThreading.numberOfWorldGenerationThreads); }
@Override
public IDhApiConfigValue<Integer> bufferBuilderThreads()
{ return new DhApiConfigValue<Integer, Integer>(MultiThreading.numberOfBufferBuilderThreads); }
@Override
public IDhApiConfigValue<Integer> fileHandlerThreads()
{ return new DhApiConfigValue<Integer, Integer>(MultiThreading.numberOfFileHandlerThreads); }
@Override
public IDhApiConfigValue<Integer> dataConverterThreads()
{ return new DhApiConfigValue<Integer, Integer>(MultiThreading.numberOfDataConverterThreads); }
@Override
public IDhApiConfigValue<Integer> chunkLodConverterThreads()
{ return new DhApiConfigValue<Integer, Integer>(MultiThreading.numberOfChunkLodConverterThreads); }
}
@@ -25,12 +25,6 @@ import com.seibel.lod.api.objects.config.DhApiConfigValue;
import com.seibel.lod.core.config.Config.Client.Advanced.Multiplayer;
import com.seibel.lod.api.enums.config.EServerFolderNameMode;
/**
* Distant Horizons' client-side multiplayer configuration.
*
* @author James Seibel
* @version 2022-9-15
*/
public class DhApiMultiplayerConfig implements IDhApiMultiplayerConfig
{
public static DhApiMultiplayerConfig INSTANCE = new DhApiMultiplayerConfig();
@@ -39,10 +33,10 @@ public class DhApiMultiplayerConfig implements IDhApiMultiplayerConfig
public IDhApiConfigValue<EServerFolderNameMode> getFolderSavingMode()
{ return new DhApiConfigValue<>(Multiplayer.serverFolderNameMode); }
public IDhApiConfigValue<EServerFolderNameMode> folderSavingMode()
{ return new DhApiConfigValue<EServerFolderNameMode, EServerFolderNameMode>(Multiplayer.serverFolderNameMode); }
public IDhApiConfigValue<Double> getMultiverseSimilarityRequirement()
{ return new DhApiConfigValue<>(Multiplayer.multiDimensionRequiredSimilarity); }
public IDhApiConfigValue<Double> multiverseSimilarityRequirement()
{ return new DhApiConfigValue<Double, Double>(Multiplayer.multiverseSimilarityRequiredPercent); }
}
@@ -20,38 +20,32 @@
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.interfaces.config.client.IDhApiNoiseTextureConfig;
import com.seibel.lod.api.objects.config.DhApiConfigValue;
import com.seibel.lod.core.config.Config.Client.Advanced.MultiThreading;
import com.seibel.lod.core.config.Config.Client.Advanced.Graphics.NoiseTextureSettings;
/**
* Distant Horizons' threading configuration.
*
* @author James Seibel
* @version 2022-9-15
*/
public class DhApiThreadingConfig implements IDhApiThreadingConfig
public class DhApiNoiseTextureConfig implements IDhApiNoiseTextureConfig
{
public static DhApiThreadingConfig INSTANCE = new DhApiThreadingConfig();
public static DhApiNoiseTextureConfig INSTANCE = new DhApiNoiseTextureConfig();
private DhApiThreadingConfig() { }
private DhApiNoiseTextureConfig() { }
@Override
public IDhApiConfigValue<Integer> getWorldGeneratorThread()
{ return new DhApiConfigValue<>(MultiThreading.numberOfWorldGenerationThreads); }
public IDhApiConfigValue<Boolean> noiseEnabled()
{ return new DhApiConfigValue<Boolean, Boolean>(NoiseTextureSettings.noiseEnabled); }
@Override
public IDhApiConfigValue<Integer> getBufferBuilderThread()
{ return new DhApiConfigValue<>(MultiThreading.numberOfBufferBuilderThreads); }
public IDhApiConfigValue<Integer> noiseSteps()
{ return new DhApiConfigValue<Integer, Integer>(NoiseTextureSettings.noiseSteps); }
@Override
public IDhApiConfigValue<Integer> getFileHandlerThread()
{ return new DhApiConfigValue<>(MultiThreading.numberOfFileHandlerThreads); }
public IDhApiConfigValue<Double> noiseIntensity()
{ return new DhApiConfigValue<Double, Double>(NoiseTextureSettings.noiseIntensity); }
@Override
public IDhApiConfigValue<Integer> getDataConverterThread()
{ return new DhApiConfigValue<>(MultiThreading.numberOfDataConverterThreads); }
public IDhApiConfigValue<Double> noiseDropoff()
{ return new DhApiConfigValue<Double, Double>(NoiseTextureSettings.noiseDropoff); }
}
@@ -17,8 +17,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.seibel.lod.core.api.external.methods.config.both;
package com.seibel.lod.core.api.external.methods.config.common;
import com.seibel.lod.api.enums.config.ELightGenerationMode;
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;
@@ -30,10 +31,10 @@ import com.seibel.lod.api.enums.worldGeneration.EDhApiDistantGeneratorMode;
/**
* Distant Horizons' world generation configuration. <br><br>
*
* Note: Fake chunks are NOT saved in Minecraft's vanilla save system.
* Note: LODs are NOT saved in Minecraft's save system.
*
* @author James Seibel
* @version 2022-9-15
* @version 2023-9-14
*/
public class DhApiWorldGenerationConfig implements IDhApiWorldGenerationConfig
{
@@ -44,22 +45,16 @@ public class DhApiWorldGenerationConfig implements IDhApiWorldGenerationConfig
@Override
public IDhApiConfigValue<Boolean> getEnableDistantWorldGeneration()
public IDhApiConfigValue<Boolean> enableDistantWorldGeneration()
{ return new DhApiConfigValue<>(WorldGenerator.enableDistantGeneration); }
@Override
public IDhApiConfigValue<EDhApiDistantGeneratorMode> getDistantGeneratorMode()
public IDhApiConfigValue<EDhApiDistantGeneratorMode> distantGeneratorMode()
{ return new DhApiConfigValue<>(WorldGenerator.distantGeneratorMode); }
@Deprecated
@Override
public IDhApiConfigValue<EBlocksToAvoid> getBlocksToAvoid()
{ return new DhApiConfigValue<>(Config.Client.Advanced.Graphics.Quality.blocksToIgnore); }
@Deprecated
@Override
public IDhApiConfigValue<Boolean> getTintWithAvoidedBlocks()
{ return new DhApiConfigValue<>(Config.Client.Advanced.Graphics.Quality.tintWithAvoidedBlocks); }
public IDhApiConfigValue<ELightGenerationMode> lightingEngine()
{ return new DhApiConfigValue<>(WorldGenerator.lightingEngine); }
}
@@ -25,7 +25,7 @@ import com.seibel.lod.coreapi.DependencyInjection.ApiEventInjector;
import com.seibel.lod.core.level.IDhClientLevel;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.coreapi.ModInfo;
import com.seibel.lod.api.enums.rendering.EDebugMode;
import com.seibel.lod.api.enums.rendering.EDebugRendering;
import com.seibel.lod.api.enums.rendering.ERendererMode;
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
import com.seibel.lod.core.level.IDhLevel;
@@ -338,8 +338,8 @@ public class ClientApi
if (glfwKey == GLFW.GLFW_KEY_F8)
{
Config.Client.Advanced.Debugging.debugMode.set(EDebugMode.next(Config.Client.Advanced.Debugging.debugMode.get()));
MC.sendChatMessage("F8: Set debug mode to " + Config.Client.Advanced.Debugging.debugMode.get());
Config.Client.Advanced.Debugging.debugRendering.set(EDebugRendering.next(Config.Client.Advanced.Debugging.debugRendering.get()));
MC.sendChatMessage("F8: Set debug mode to " + Config.Client.Advanced.Debugging.debugRendering.get());
}
else if (glfwKey == GLFW.GLFW_KEY_F6)
{
@@ -49,28 +49,9 @@ import java.util.*;
public class Config
{
// TODO update this diagram
// CONFIG STRUCTURE
// -> Client
// |
// |-> Graphics
// | |-> Quality
// | |-> FogQuality
// | |-> AdvancedGraphics
// | |-> NoiseTextureSettings
// |
// |-> World Generation
// |
// |-> Advanced
// |-> Threads
// |-> GpuBuffers
// |-> Debugging
// Since the original config system uses forge stuff, that means we have to rewrite the whole config system
public static ConfigCategory client = new ConfigCategory.Builder().set(Client.class).build();
public static class Client
{
public static ConfigEntry<Boolean> quickEnableRendering = new ConfigEntry.Builder<Boolean>()
@@ -147,20 +128,20 @@ public class Config
public static class Quality
{
public static ConfigEntry<EHorizontalResolution> drawResolution = new ConfigEntry.Builder<EHorizontalResolution>()
.set(EHorizontalResolution.BLOCK)
public static ConfigEntry<EMaxHorizontalResolution> maxHorizontalResolution = new ConfigEntry.Builder<EMaxHorizontalResolution>()
.set(EMaxHorizontalResolution.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"
+ EMaxHorizontalResolution.CHUNK + ": render 1 LOD for each Chunk. \n"
+ EMaxHorizontalResolution.HALF_CHUNK + ": render 4 LODs for each Chunk. \n"
+ EMaxHorizontalResolution.FOUR_BLOCKS + ": render 16 LODs for each Chunk. \n"
+ EMaxHorizontalResolution.TWO_BLOCKS + ": render 64 LODs for each Chunk. \n"
+ EMaxHorizontalResolution.BLOCK + ": render 256 LODs for each Chunk (width of one block). \n"
+ "\n"
+ "Lowest Quality: " + EHorizontalResolution.CHUNK + "\n"
+ "Highest Quality: " + EHorizontalResolution.BLOCK)
+ "Lowest Quality: " + EMaxHorizontalResolution.CHUNK + "\n"
+ "Highest Quality: " + EMaxHorizontalResolution.BLOCK)
.addListener(RenderCacheConfigEventHandler.INSTANCE)
.setPerformance(EConfigEntryPerformance.MEDIUM)
.build();
@@ -185,15 +166,6 @@ public class Config
.addListener(RenderCacheConfigEventHandler.INSTANCE)
.build();
// TODO merge with horizontal quality
public static ConfigEntry<Integer> horizontalScale = new ConfigEntry.Builder<Integer>()
.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<Boolean> ssao = new ConfigEntry.Builder<Boolean>()
.set(true)
.comment("Enable Screen Space Ambient Occlusion")
@@ -261,7 +233,7 @@ public class Config
public static class Fog
{
public static ConfigEntry<EFogDrawMode> fogDrawMode = new ConfigEntry.Builder<EFogDrawMode>()
public static ConfigEntry<EFogDrawMode> drawMode = new ConfigEntry.Builder<EFogDrawMode>()
.set(EFogDrawMode.FOG_ENABLED)
.comment(""
+ "When should fog be drawn? \n"
@@ -275,13 +247,13 @@ public class Config
.setPerformance(EConfigEntryPerformance.VERY_LOW)
.build();
public static ConfigEntry<EFogDistance> fogDistance = new ConfigEntry.Builder<EFogDistance>()
public static ConfigEntry<EFogDistance> distance = new ConfigEntry.Builder<EFogDistance>()
.set(EFogDistance.FAR)
.comment("At what distance should Fog be drawn on the LODs?")
.setPerformance(EConfigEntryPerformance.NONE)
.build();
public static ConfigEntry<EFogColorMode> fogColorMode = new ConfigEntry.Builder<EFogColorMode>()
public static ConfigEntry<EFogColorMode> colorMode = new ConfigEntry.Builder<EFogColorMode>()
.set(EFogColorMode.USE_WORLD_FOG_COLOR)
.comment(""
+ "What color should fog use? \n"
@@ -370,8 +342,6 @@ public class Config
public static class HeightFog
{
public static ConfigUIComment heightFogConfigScreenNote = new ConfigUIComment();
public static ConfigEntry<EHeightFogMixMode> heightFogMixMode = new ConfigEntry.Builder<EHeightFogMixMode>()
.set(EHeightFogMixMode.BASIC)
.comment(""
@@ -405,7 +375,7 @@ public class Config
+ 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<Double> heightFogHeight = new ConfigEntry.Builder<Double>()
public static ConfigEntry<Double> heightFogBaseHeight = new ConfigEntry.Builder<Double>()
.setMinDefaultMax(-4096.0, 70.0, 4096.0)
.comment("If the height fog is calculated around a set height, what is that height position?")
.build();
@@ -467,7 +437,7 @@ public class Config
public static class NoiseTextureSettings
{
public static ConfigEntry<Boolean> noiseEnable = new ConfigEntry.Builder<Boolean>()
public static ConfigEntry<Boolean> noiseEnabled = new ConfigEntry.Builder<Boolean>()
.set(true)
.comment(""
+ "Should a noise texture be applied to LODs? \n"
@@ -708,7 +678,7 @@ public class Config
+ EServerFolderNameMode.NAME_IP_PORT_MC_VERSION + ": Example: \"Minecraft Server IP 192.168.1.40:25565 GameVersion 1.16.5\"")
.build();
public static ConfigEntry<Double> multiDimensionRequiredSimilarity = new ConfigEntry.Builder<Double>()
public static ConfigEntry<Double> multiverseSimilarityRequiredPercent = new ConfigEntry.Builder<Double>()
.setMinDefaultMax(0.0, 0.0, 1.0)
.comment(""
+ "AKA: Multiverse support. \n"
@@ -971,15 +941,15 @@ public class Config
+ ERendererMode.DISABLED + ": Disable rendering")
.build();
public static ConfigEntry<EDebugMode> debugMode = new ConfigEntry.Builder<EDebugMode>()
.set(EDebugMode.OFF)
public static ConfigEntry<EDebugRendering> debugRendering = new ConfigEntry.Builder<EDebugRendering>()
.set(EDebugRendering.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"
+ EDebugRendering.OFF + ": Fake chunks will be drawn with their normal colors. \n"
+ EDebugRendering.SHOW_DETAIL + ": Fake chunks color will be based on their detail level. \n"
+ EDebugRendering.SHOW_GENMODE + ": Fake chunks color will be based on their distant generation mode. \n"
+ EDebugRendering.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();
@@ -1089,6 +1059,7 @@ public class Config
}
// TODO implement
public static class ResetConfirmation
{
public static ConfigUIComment resetConfirmationNote = new ConfigUIComment();
@@ -1,7 +1,7 @@
package com.seibel.lod.core.config.eventHandlers;
import com.seibel.lod.api.DhApiMain;
import com.seibel.lod.api.enums.config.EHorizontalResolution;
import com.seibel.lod.api.enums.config.EMaxHorizontalResolution;
import com.seibel.lod.api.enums.config.EVerticalQuality;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.config.listeners.IConfigListener;
@@ -21,7 +21,7 @@ public class RenderCacheConfigEventHandler implements IConfigListener
// previous values used to check if a watched setting was actually modified
private EVerticalQuality previousVerticalQualitySetting = null;
private EHorizontalResolution previousHorizontalResolution = null;
private EMaxHorizontalResolution previousHorizontalResolution = null;
/** how long to wait in milliseconds before applying the config changes */
private static final long TIMEOUT_IN_MS = 400L;
@@ -47,7 +47,7 @@ public class RenderCacheConfigEventHandler implements IConfigListener
refreshRenderData = true;
}
EHorizontalResolution newHorizontalResolution = Config.Client.Advanced.Graphics.Quality.drawResolution.get();
EMaxHorizontalResolution newHorizontalResolution = Config.Client.Advanced.Graphics.Quality.maxHorizontalResolution.get();
if (this.previousHorizontalResolution != newHorizontalResolution)
{
this.previousHorizontalResolution = newHorizontalResolution;
@@ -1,7 +1,7 @@
package com.seibel.lod.core.config.eventHandlers.presets;
import com.seibel.lod.api.enums.config.EHorizontalQuality;
import com.seibel.lod.api.enums.config.EHorizontalResolution;
import com.seibel.lod.api.enums.config.EMaxHorizontalResolution;
import com.seibel.lod.api.enums.config.EVerticalQuality;
import com.seibel.lod.api.enums.config.quickOptions.EQualityPreset;
import com.seibel.lod.api.enums.rendering.ETransparency;
@@ -21,14 +21,14 @@ public class RenderQualityPresetConfigEventHandler extends AbstractPresetConfigE
private static final Logger LOGGER = LogManager.getLogger();
private final ConfigEntryWithPresetOptions<EQualityPreset, EHorizontalResolution> drawResolution = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.Graphics.Quality.drawResolution,
new HashMap<EQualityPreset, EHorizontalResolution>()
private final ConfigEntryWithPresetOptions<EQualityPreset, EMaxHorizontalResolution> drawResolution = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.Graphics.Quality.maxHorizontalResolution,
new HashMap<EQualityPreset, EMaxHorizontalResolution>()
{{
this.put(EQualityPreset.MINIMUM, EHorizontalResolution.TWO_BLOCKS);
this.put(EQualityPreset.LOW, EHorizontalResolution.BLOCK);
this.put(EQualityPreset.MEDIUM, EHorizontalResolution.BLOCK);
this.put(EQualityPreset.HIGH, EHorizontalResolution.BLOCK);
this.put(EQualityPreset.EXTREME, EHorizontalResolution.BLOCK);
this.put(EQualityPreset.MINIMUM, EMaxHorizontalResolution.TWO_BLOCKS);
this.put(EQualityPreset.LOW, EMaxHorizontalResolution.BLOCK);
this.put(EQualityPreset.MEDIUM, EMaxHorizontalResolution.BLOCK);
this.put(EQualityPreset.HIGH, EMaxHorizontalResolution.BLOCK);
this.put(EQualityPreset.EXTREME, EMaxHorizontalResolution.BLOCK);
}});
private final ConfigEntryWithPresetOptions<EQualityPreset, EVerticalQuality> verticalQuality = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.Graphics.Quality.verticalQuality,
new HashMap<EQualityPreset, EVerticalQuality>()
@@ -1,7 +1,7 @@
package com.seibel.lod.core.dataObjects.render.bufferBuilding;
import com.seibel.lod.api.enums.config.EGpuUploadMethod;
import com.seibel.lod.api.enums.rendering.EDebugMode;
import com.seibel.lod.api.enums.rendering.EDebugRendering;
import com.seibel.lod.api.enums.rendering.EGLProxyContext;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.config.listeners.ConfigChangeListener;
@@ -159,7 +159,7 @@ public class ColumnRenderBufferBuilder
private static void makeLodRenderData(LodQuadBuilder quadBuilder, ColumnRenderSource renderSource, ColumnRenderSource[] adjRegions)
{
// Variable initialization
EDebugMode debugMode = Config.Client.Advanced.Debugging.debugMode.get();
EDebugRendering debugMode = Config.Client.Advanced.Debugging.debugRendering.get();
// can be uncommented to limit which section positions are build and thus, rendered
// useful when debugging a specific section
@@ -22,7 +22,7 @@ package com.seibel.lod.core.dataObjects.render.bufferBuilding;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.dataObjects.render.ColumnRenderSource;
import com.seibel.lod.core.util.RenderDataPointUtil;
import com.seibel.lod.api.enums.rendering.EDebugMode;
import com.seibel.lod.api.enums.rendering.EDebugRendering;
import com.seibel.lod.core.dataObjects.render.columnViews.ColumnArrayView;
import com.seibel.lod.core.pos.DhLodPos;
import com.seibel.lod.coreapi.util.BitShiftUtil;
@@ -40,7 +40,7 @@ public class CubicLodTemplate
public static void addLodToBuffer(
long data, long topData, long bottomData, ColumnArrayView[][] adjData,
byte detailLevel, int offsetPosX, int offsetOosZ, LodQuadBuilder quadBuilder,
EDebugMode debugging, ColumnRenderSource.DebugSourceFlag debugSource)
EDebugRendering debugging, ColumnRenderSource.DebugSourceFlag debugSource)
{
DhLodPos blockOffsetPos = new DhLodPos(detailLevel, offsetPosX, offsetOosZ).convertToDetailLevel(LodUtil.BLOCK_DETAIL_LEVEL);
@@ -58,7 +58,7 @@ public class ClientOnlySaveStructure extends AbstractSaveStructure
{
return this.levelToFileMap.computeIfAbsent(level, (newLevel) ->
{
if (Config.Client.Advanced.Multiplayer.multiDimensionRequiredSimilarity.get() == 0)
if (Config.Client.Advanced.Multiplayer.multiverseSimilarityRequiredPercent.get() == 0)
{
if (this.fileMatcher != null)
{
@@ -78,7 +78,7 @@ public class SubDimCompare implements Comparable<SubDimCompare>
/** Returns true if this sub dimension is close enough to be considered a valid sub dimension */
public boolean isValidSubDim()
{
double minimumSimilarityRequired = Config.Client.Advanced.Multiplayer.multiDimensionRequiredSimilarity.get();
double minimumSimilarityRequired = Config.Client.Advanced.Multiplayer.multiverseSimilarityRequiredPercent.get();
return this.getPercentEqual() >= minimumSimilarityRequired
|| this.playerPosDist <= MAX_SIMILAR_PLAYER_POS_DISTANCE_IN_BLOCKS;
}
@@ -337,7 +337,7 @@ public class LodQuadTree extends QuadTree<LodRenderSection> implements AutoClose
private void updateDetailLevelVariables()
{
this.maxRenderDetailLevel = Config.Client.Advanced.Graphics.Quality.drawResolution.get().detailLevel;
this.maxRenderDetailLevel = Config.Client.Advanced.Graphics.Quality.maxHorizontalResolution.get().detailLevel;
this.detailDropOffDistanceUnit = Config.Client.Advanced.Graphics.Quality.horizontalQuality.get().distanceUnitInBlocks * LodUtil.CHUNK_WIDTH;
this.detailDropOffLogBase = Math.log(Config.Client.Advanced.Graphics.Quality.horizontalQuality.get().quadraticBase);
}
@@ -66,7 +66,7 @@ public class LodFogConfig
public static LodFogConfig generateFogConfig()
{
EFogDrawMode fogMode = Config.Client.Advanced.Graphics.Fog.fogDrawMode.get();
EFogDrawMode fogMode = Config.Client.Advanced.Graphics.Fog.drawMode.get();
if (fogMode == EFogDrawMode.USE_OPTIFINE_SETTING && OPTIFINE != null)
{
fogMode = OPTIFINE.getFogDrawMode();
@@ -80,7 +80,7 @@ public class LodFogConfig
// TODO: Move these out of here
earthCurveRatio = Config.Client.Advanced.Graphics.AdvancedGraphics.earthCurveRatio.get();
noiseEnable = Config.Client.Advanced.Graphics.NoiseTextureSettings.noiseEnable.get();
noiseEnable = Config.Client.Advanced.Graphics.NoiseTextureSettings.noiseEnabled.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();
@@ -88,7 +88,7 @@ public class LodFogConfig
if (fogDrawMode != EFogDrawMode.FOG_DISABLED)
{
EFogDistance fogDistance = Config.Client.Advanced.Graphics.Fog.fogDistance.get();
EFogDistance fogDistance = Config.Client.Advanced.Graphics.Fog.distance.get();
drawNearFog = (fogDistance == EFogDistance.NEAR || fogDistance == EFogDistance.NEAR_AND_FAR);
if (fogDistance == EFogDistance.FAR || fogDistance == EFogDistance.NEAR_AND_FAR)
@@ -134,7 +134,7 @@ public class LodFogConfig
}
else
{
heightFogHeight = Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogHeight.get().floatValue();
heightFogHeight = Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogBaseHeight.get().floatValue();
}
}
}
@@ -20,7 +20,7 @@
package com.seibel.lod.core.render.renderer;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.api.enums.rendering.EDebugMode;
import com.seibel.lod.api.enums.rendering.EDebugRendering;
import com.seibel.lod.api.enums.rendering.EFogColorMode;
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
import com.seibel.lod.core.logging.ConfigBasedLogger;
@@ -104,7 +104,7 @@ public class LodRenderer
private static final IMinecraftClientWrapper MC = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
private static final IMinecraftRenderWrapper MC_RENDER = SingletonInjector.INSTANCE.get(IMinecraftRenderWrapper.class);
public EDebugMode previousDebugMode = null;
public EDebugRendering previousDebugMode = null;
public final RenderBufferHandler bufferHandler;
// The shader program
@@ -314,7 +314,7 @@ public class LodRenderer
{
Color fogColor;
if (Config.Client.Advanced.Graphics.Fog.fogColorMode.get() == EFogColorMode.USE_SKY_COLOR)
if (Config.Client.Advanced.Graphics.Fog.colorMode.get() == EFogColorMode.USE_SKY_COLOR)
fogColor = MC_RENDER.getSkyColor();
else
fogColor = MC_RENDER.getFogColor(partialTicks);
@@ -78,9 +78,9 @@
"lod.config.client.advanced.graphics.quality":
"Render Quality",
"lod.config.client.advanced.graphics.quality.drawResolution":
"Draw Resolution",
"lod.config.client.advanced.graphics.quality.drawResolution.@tooltip":
"lod.config.client.advanced.graphics.quality.maxHorizontalResolution":
"Max Horizontal Resolution",
"lod.config.client.advanced.graphics.quality.maxHorizontalResolution.@tooltip":
"The maximum detail LODs are rendered at.\n\n§6Fastest:§r Chunk\n§6Fanciest:§r Block",
"lod.config.client.advanced.graphics.quality.lodChunkRenderDistance":
"LOD Render Distance",
@@ -121,17 +121,17 @@
"lod.config.client.advanced.graphics.fog":
"Fog",
"lod.config.client.advanced.graphics.fog.fogDrawMode":
"lod.config.client.advanced.graphics.fog.drawMode":
"Fog Draw Mode",
"lod.config.client.advanced.graphics.fog.fogDrawMode.@tooltip":
"lod.config.client.advanced.graphics.fog.drawMode.@tooltip":
"When fog will be rendered on the LODs.",
"lod.config.client.advanced.graphics.fog.fogDistance":
"lod.config.client.advanced.graphics.fog.distance":
"Fog Distance",
"lod.config.client.advanced.graphics.fog.fogDistance.@tooltip":
"lod.config.client.advanced.graphics.fog.distance.@tooltip":
"The distance(s) Fog will be rendered on the LODs.",
"lod.config.client.advanced.graphics.fog.fogColorMode":
"lod.config.client.advanced.graphics.fog.colorMode":
"Fog Color Mode",
"lod.config.client.advanced.graphics.fog.fogColorMode.@tooltip":
"lod.config.client.advanced.graphics.fog.colorMode.@tooltip":
"The color of the fog on LODs.",
"lod.config.client.advanced.graphics.fog.disableVanillaFog":
"Disable Vanilla Fog",
@@ -167,10 +167,7 @@
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog":
"Height Fog Options",
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogConfigScreenNote":
"",
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogMixMode":
"Height Fog Mix Mode",
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogMixMode.@tooltip":
@@ -179,9 +176,9 @@
"Height Fog Mode",
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogMode.@tooltip":
"Where should the height fog be located? \n\nABOVE_CAMERA: Height fog starts from camera to the sky \nBELOW_CAMERA: Height fog starts from camera to the void \nABOVE_AND_BELOW_CAMERA: Height fog starts from camera to both the sky and the void \nABOVE_SET_HEIGHT: Height fog starts from a set height to the sky \nBELOW_SET_HEIGHT: Height fog starts from a set height to the void \nABOVE_AND_BELOW_SET_HEIGHT: Height fog starts from a set height to both the sky and the void \n",
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogHeight":
"Height Fog Set Height",
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogHeight.@tooltip":
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogBaseHeight":
"Height Fog Base Height",
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogBaseHeight.@tooltip":
"If the height fog is calculated around a set height, what is that height position? ",
"lod.config.client.advanced.graphics.fog.advancedFog.heightFog.heightFogStart":
"Height Fog Start",
@@ -212,9 +209,9 @@
"lod.config.client.advanced.graphics.noiseTextureSettings":
"Noise Texture",
"lod.config.client.advanced.graphics.noiseTextureSettings.noiseEnable":
"lod.config.client.advanced.graphics.noiseTextureSettings.noiseEnabled":
"Enable Noise Texture",
"lod.config.client.advanced.graphics.noiseTextureSettings.noiseEnable.@tooltip":
"lod.config.client.advanced.graphics.noiseTextureSettings.noiseEnabled.@tooltip":
"If enabled a noise texture will be applied to LODs to simulate textures.",
"lod.config.client.advanced.graphics.noiseTextureSettings.noiseSteps":
"Noise Steps",
@@ -291,9 +288,9 @@
"Server Folder Mode",
"lod.config.client.multiplayer.serverFolderNameMode.@tooltip":
"Determines the folder format for local multiplayer data.\n\n§6Name Only:§r\nUses the server browser name. Ex: \"Minecraft Server\"\n§6Name IP:§r\n\"Minecraft Server, IP 192.168.1.40\"\n§6Name, IP, Port:§r\n\"Minecraft Server, IP 192.168.1.40:25565\"\n§6Name, IP, Port, MC Version:§r\n\"Minecraft Server, IP 192.168.1.40:25565, GameVersion 1.18.1\"\n\n§c§lCaution:§r changing while connected to a multiplayer server may cause glitches.",
"lod.config.client.advanced.multiplayer.multiDimensionRequiredSimilarity":
"Multiverse Dimension Required Similarity",
"lod.config.client.multiplayer.multiDimensionRequiredSimilarity.@tooltip":
"lod.config.client.advanced.multiplayer.multiverseSimilarityRequiredPercent":
"Multiverse Required Similarity %",
"lod.config.client.advanced.multiplayer.multiverseSimilarityRequiredPercent.@tooltip":
"When matching worlds of the same dimension type the\ntested chunk(s) must be at least this percent the same\nin order to be considered the same world.\n\nNote: If you use portals to enter a dimension at two\ndifferent locations this system may think it is two different worlds.\n\n§61.0:§r the chunks must be identical.\n§60.5:§r the chunks must be half the same.\n§60.0:§r disables multi-dimension support\n only one world will be used per dimension.",
@@ -469,15 +466,15 @@
"lod.config.enum.EThreadPreset.I_PAID_FOR_THE_WHOLE_CPU":
"I Paid For The Whole CPU",
"lod.config.enum.EHorizontalResolution.BLOCK":
"lod.config.enum.EMaxHorizontalResolution.BLOCK":
"Block",
"lod.config.enum.EHorizontalResolution.TWO_BLOCKS":
"lod.config.enum.EMaxHorizontalResolution.TWO_BLOCKS":
"2 blocks",
"lod.config.enum.EHorizontalResolution.FOUR_BLOCKS":
"lod.config.enum.EMaxHorizontalResolution.FOUR_BLOCKS":
"4 blocks",
"lod.config.enum.EHorizontalResolution.HALF_CHUNK":
"lod.config.enum.EMaxHorizontalResolution.HALF_CHUNK":
"Half a chunk",
"lod.config.enum.EHorizontalResolution.CHUNK":
"lod.config.enum.EMaxHorizontalResolution.CHUNK":
"Chunk",
"lod.config.enum.EVerticalQuality.HEIGHT_MAP":
@@ -635,15 +632,15 @@
"lod.config.enum.ERendererMode.DISABLED":
"Disabled",
"lod.config.enum.EDebugMode.OFF":
"lod.config.enum.EDebugRendering.OFF":
"Off",
"lod.config.enum.EDebugMode.SHOW_DETAIL":
"lod.config.enum.EDebugRendering.SHOW_DETAIL":
"Show detail",
"lod.config.enum.EDebugMode.SHOW_GENMODE":
"lod.config.enum.EDebugRendering.SHOW_GENMODE":
"Show generation mode",
"lod.config.enum.EDebugMode.SHOW_OVERLAPPING_QUADS":
"lod.config.enum.EDebugRendering.SHOW_OVERLAPPING_QUADS":
"Show overlapping quads",
"lod.config.enum.EDebugMode.SHOW_RENDER_SOURCE_FLAG":
"lod.config.enum.EDebugRendering.SHOW_RENDER_SOURCE_FLAG":
"Show render source flag",
"lod.config.enum.ELoggerMode.DISABLED":