From cedffb03d8e198bc43d97aa7e399883742b95a84 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 5 Jul 2022 21:17:22 -0500 Subject: [PATCH] Update the DhApi buffer comments and move one item Geometry rebuild frequency is more of a graphic setting than a buffer setting. --- .../external/config/client/DhApiBuffers.java | 34 ++++++++----------- .../config/client/graphics/DhApiGraphics.java | 6 +++- .../client/graphics/DhApiGraphicsFog.java | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiBuffers.java b/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiBuffers.java index ee0e3d42d..7a9f69729 100644 --- a/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiBuffers.java +++ b/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiBuffers.java @@ -29,35 +29,31 @@ import com.seibel.lod.core.enums.config.EBufferRebuildTimes; import com.seibel.lod.core.enums.config.EGpuUploadMethod; /** - * Distant Horizons OpenGL buffer configuration. + * Distant Horizons' OpenGL buffer configuration. * * @author James Seibel - * @version 2022-7-4 + * @version 2022-7-5 */ public class DhApiBuffers { + // developer note: + // DhApiConfig needs types explicitly defined otherwise Intellij + // won't do type checking and the wrong types can be used. + // For example returning IDhApiConfig when the config should be a Boolean. - /** - * Returns the config related to how geometry data is - * uploaded to the GPU. - */ + + /** Defines how geometry data is uploaded to the GPU. */ public static IDhApiConfig getGpuUploadMethodConfig() - { return new DhApiConfig<>(Buffers.gpuUploadMethod, new GenericEnumConverter<>(EGpuUploadMethod.class, EDhApiGpuUploadMethod.class)); } + { return new DhApiConfig(Buffers.gpuUploadMethod, new GenericEnumConverter<>(EGpuUploadMethod.class, EDhApiGpuUploadMethod.class)); } /** - * Returns the config related to how long we should wait after - * uploading one Megabyte of geometry data to the GPU before uploading - * the next Megabyte of data. + * Defines how long we should wait after uploading one + * Megabyte of geometry data to the GPU before uploading + * the next Megabyte of data.
+ * This can be set to a non-zero number to reduce stuttering caused by + * uploading buffers to the GPU. */ public static IDhApiConfig getBufferUploadTimeoutPerMegabyteInMillisecondsConfig() - { return new DhApiConfig<>(Buffers.gpuUploadPerMegabyteInMilliseconds); } - - /** - * Returns the config related to how long we should wait after - * uploading one Megabyte of geometry data to the GPU before uploading - * the next Megabyte of data. - */ - public static IDhApiConfig getBufferRebuildTimeConfig() - { return new DhApiConfig<>(Buffers.rebuildTimes, new GenericEnumConverter<>(EBufferRebuildTimes.class, EDhApiBufferRebuildTimes.class)); } + { return new DhApiConfig(Buffers.gpuUploadPerMegabyteInMilliseconds); } } diff --git a/src/main/java/com/seibel/lod/core/api/external/config/client/graphics/DhApiGraphics.java b/src/main/java/com/seibel/lod/core/api/external/config/client/graphics/DhApiGraphics.java index a0d703cb6..5142c1962 100644 --- a/src/main/java/com/seibel/lod/core/api/external/config/client/graphics/DhApiGraphics.java +++ b/src/main/java/com/seibel/lod/core/api/external/config/client/graphics/DhApiGraphics.java @@ -33,7 +33,7 @@ import com.seibel.lod.core.config.Config.Client.Advanced.Debugging; import com.seibel.lod.core.config.Config.Client.Graphics.AdvancedGraphics; /** - * Distant Horizons graphics/rendering configuration. + * Distant Horizons' graphics/rendering configuration. * * @author James Seibel * @version 2022-7-5 @@ -169,6 +169,10 @@ public class DhApiGraphics public static IDhApiConfig getEnableLodOnlyModeConfig() { return new DhApiConfig(Config.Client.Advanced.lodOnlyMode); } + /** Defines how often the geometry should be rebuilt when the player moves. */ + public static IDhApiConfig getGeometryRebuildFrequencyConfig() + { return new DhApiConfig(Config.Client.Advanced.Buffers.rebuildTimes, new GenericEnumConverter<>(EBufferRebuildTimes.class, EDhApiBufferRebuildTimes.class)); } + } diff --git a/src/main/java/com/seibel/lod/core/api/external/config/client/graphics/DhApiGraphicsFog.java b/src/main/java/com/seibel/lod/core/api/external/config/client/graphics/DhApiGraphicsFog.java index 19262d5ce..ae328b514 100644 --- a/src/main/java/com/seibel/lod/core/api/external/config/client/graphics/DhApiGraphicsFog.java +++ b/src/main/java/com/seibel/lod/core/api/external/config/client/graphics/DhApiGraphicsFog.java @@ -27,7 +27,7 @@ import com.seibel.lod.core.enums.rendering.*; import com.seibel.lod.core.config.Config.Client.Graphics.FogQuality; /** - * Distant Horizons fog configuration.

+ * Distant Horizons' fog configuration.

* * Note: unless an option explicitly states that it modifies * Minecraft's vanilla rendering (like DisableVanillaFog)