diff --git a/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiBufferRebuildTimes.java b/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiBufferRebuildTimes.java new file mode 100644 index 000000000..e263d655c --- /dev/null +++ b/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiBufferRebuildTimes.java @@ -0,0 +1,39 @@ +/* + * 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.core.api.external.apiObjects.enums; + +/** + * CONSTANT
+ * FREQUENT
+ * NORMAL
+ * RARE

+ * + * Determines how fast the buffers should be regenerated + * + * @author Leonardo Amato + * @version 9-25-2021 + */ +public enum EDhApiBufferRebuildTimes +{ + CONSTANT, + FREQUENT, + NORMAL, + RARE; +} diff --git a/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiGpuUploadMethod.java b/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiGpuUploadMethod.java new file mode 100644 index 000000000..33d5d0245 --- /dev/null +++ b/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiGpuUploadMethod.java @@ -0,0 +1,64 @@ +/* + * 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.core.api.external.apiObjects.enums; + +/** + * AUTO,
+ * BUFFER_STORAGE,
+ * SUB_DATA,
+ * BUFFER_MAPPING,
+ * DATA
+ * + * @author Leetom + * @author James Seibel + * @version 2022-7-2 + */ +public enum EDhApiGpuUploadMethod +{ + /** Picks the best option based on the GPU the user has. */ + AUTO, + + /** + * Default for NVIDIA if OpenGL 4.5 is supported.
+ * Fast rendering, no stuttering. + */ + BUFFER_STORAGE, + + /** + * Backup option for NVIDIA.
+ * Fast rendering but may stutter when uploading. + */ + SUB_DATA, + + /** + * Default option for AMD/Intel.
+ * May end up storing buffers in System memory.
+ * Fast rending if in GPU memory, slow if in system memory,
+ * but won't stutter when uploading. + */ + BUFFER_MAPPING, + + /** + * Backup option for AMD/Intel.
+ * Fast rendering but may stutter when uploading. + */ + DATA; + +} \ No newline at end of file diff --git a/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiGeometry.java b/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiGeometry.java new file mode 100644 index 000000000..bc5cc1a6d --- /dev/null +++ b/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiGeometry.java @@ -0,0 +1,45 @@ +package com.seibel.lod.core.api.external.config.client; + +import com.seibel.lod.core.api.external.apiObjects.enums.EDhApiBufferRebuildTimes; +import com.seibel.lod.core.api.external.apiObjects.enums.EDhApiGpuUploadMethod; +import com.seibel.lod.core.api.external.apiObjects.wrapperInterfaces.IDhApiConfig; +import com.seibel.lod.core.api.implementation.objects.GenericEnumConverter; +import com.seibel.lod.core.api.implementation.wrappers.DhApiConfig; +import com.seibel.lod.core.config.Config.Client.Advanced.Buffers; +import com.seibel.lod.core.enums.config.EBufferRebuildTimes; +import com.seibel.lod.core.enums.config.EGpuUploadMethod; + + +/** + * General Threading settings. + * + * @author James Seibel + * @version 2022-6-13 + */ +public class DhApiGeometry +{ + + /** + * Returns the config related to how geometry data is + * uploaded to the GPU. + */ + public static IDhApiConfig getGpuUploadMethodConfig() + { 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. + */ + 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)); } + +} diff --git a/src/main/java/com/seibel/lod/core/enums/config/EBufferRebuildTimes.java b/src/main/java/com/seibel/lod/core/enums/config/EBufferRebuildTimes.java index ce252fe54..2c68f910f 100644 --- a/src/main/java/com/seibel/lod/core/enums/config/EBufferRebuildTimes.java +++ b/src/main/java/com/seibel/lod/core/enums/config/EBufferRebuildTimes.java @@ -20,11 +20,12 @@ package com.seibel.lod.core.enums.config; /** + * CONSTANT
* FREQUENT
* NORMAL
- * RARE
- *
- * Determines how fast the buffers need to be regenerated + * RARE

+ * + * Determines how fast the buffers should be regenerated * * @author Leonardo Amato * @version 9-25-2021 diff --git a/src/main/java/com/seibel/lod/core/enums/config/EGpuUploadMethod.java b/src/main/java/com/seibel/lod/core/enums/config/EGpuUploadMethod.java index c860e290a..83ffb0d1a 100644 --- a/src/main/java/com/seibel/lod/core/enums/config/EGpuUploadMethod.java +++ b/src/main/java/com/seibel/lod/core/enums/config/EGpuUploadMethod.java @@ -20,19 +20,23 @@ package com.seibel.lod.core.enums.config; /** - * Auto, BUFFER_STORAGE_MAPPING, Buffer_Storage, Sub_Data, Buffer_Mapping, Data - * + * AUTO,
+ * BUFFER_STORAGE,
+ * SUB_DATA,
+ * BUFFER_MAPPING,
+ * DATA
+ * + * @author Leetom * @author James Seibel - * @version 12-1-2021 + * @version 2022-7-2 */ public enum EGpuUploadMethod { /** Picks the best option based on the GPU the user has. */ AUTO(false, false), - /* - */ - BUFFER_STORAGE_MAPPING(true, true), + // commented out since it isn't currently in use + //BUFFER_STORAGE_MAPPING(true, true), /** * Default for NVIDIA if OpenGL 4.5 is supported.