Split up the configs to make it easier to understand
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package com.seibel.lod;
|
||||
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.proxy.ClientProxy;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -49,7 +49,7 @@ public class LodMain
|
||||
|
||||
private void init(final FMLCommonSetupEvent event)
|
||||
{
|
||||
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, LodConfig.clientSpec);
|
||||
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, LodConfig.CLIENT_SPEC);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.objects.LodDimension;
|
||||
import com.seibel.lod.objects.RegionPos;
|
||||
import com.seibel.lod.objects.LevelPos.LevelPos;
|
||||
@@ -60,7 +60,7 @@ public class LodBufferBuilder
|
||||
/**
|
||||
* This holds the threads used to generate buffers.
|
||||
*/
|
||||
private ExecutorService bufferBuilderThreads = Executors.newFixedThreadPool(LodConfig.CLIENT.numberOfBufferBuilderThreads.get(), new LodThreadFactory(this.getClass().getSimpleName() + " - builder"));
|
||||
private ExecutorService bufferBuilderThreads = Executors.newFixedThreadPool(LodConfig.CLIENT.threading.numberOfBufferBuilderThreads.get(), new LodThreadFactory(this.getClass().getSimpleName() + " - builder"));
|
||||
|
||||
/**
|
||||
* The buffers that are used to create LODs using far fog
|
||||
@@ -294,7 +294,7 @@ public class LodBufferBuilder
|
||||
}
|
||||
posToRender.changeParameters(detailLevel, posX, posZ);
|
||||
|
||||
LodConfig.CLIENT.lodTemplate.get().template.addLodToBuffer(currentBuffer, playerBlockPos, lodData, adjData,
|
||||
LodConfig.CLIENT.graphics.lodTemplate.get().template.addLodToBuffer(currentBuffer, playerBlockPos, lodData, adjData,
|
||||
posToRender, renderer.previousDebugMode);
|
||||
}
|
||||
} catch (ArrayIndexOutOfBoundsException e)
|
||||
|
||||
@@ -21,9 +21,9 @@ import java.awt.Color;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.DistanceGenerationMode;
|
||||
import com.seibel.lod.enums.LodDetail;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.objects.DataPoint;
|
||||
import com.seibel.lod.objects.LodDimension;
|
||||
import com.seibel.lod.objects.LodWorld;
|
||||
@@ -117,7 +117,7 @@ public class LodBuilder
|
||||
lodDim = lodWorld.getLodDimension(dim);
|
||||
}
|
||||
|
||||
generateLodNodeFromChunk(lodDim, chunk, new LodBuilderConfig(generationMode), LodConfig.CLIENT.maxGenerationDetail.get());
|
||||
generateLodNodeFromChunk(lodDim, chunk, new LodBuilderConfig(generationMode), LodConfig.CLIENT.worldGenerator.maxGenerationDetail.get());
|
||||
} catch (IllegalArgumentException | NullPointerException e)
|
||||
{
|
||||
System.out.println("Chunk pos " + chunk.getPos());
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
*/
|
||||
package com.seibel.lod.builders.lodTemplates;
|
||||
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.DebugMode;
|
||||
import com.seibel.lod.enums.ShadingMode;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.objects.DataPoint;
|
||||
import com.seibel.lod.objects.LevelPos.LevelPos;
|
||||
import com.seibel.lod.util.ColorUtil;
|
||||
@@ -102,7 +102,7 @@ public class CubicLodTemplate extends AbstractLodTemplate
|
||||
int eastColor = c;
|
||||
|
||||
// darken the bottom and side colors if requested
|
||||
if (LodConfig.CLIENT.shadingMode.get() == ShadingMode.DARKEN_SIDES)
|
||||
if (LodConfig.CLIENT.graphics.shadingMode.get() == ShadingMode.DARKEN_SIDES)
|
||||
{
|
||||
// the side colors are different because
|
||||
// when using fast lighting in Minecraft the north/south
|
||||
@@ -118,8 +118,8 @@ public class CubicLodTemplate extends AbstractLodTemplate
|
||||
}
|
||||
|
||||
// apply the user specified saturation and brightness
|
||||
float saturationMultiplier = LodConfig.CLIENT.saturationMultiplier.get().floatValue();
|
||||
float brightnessMultiplier = LodConfig.CLIENT.brightnessMultiplier.get().floatValue();
|
||||
float saturationMultiplier = LodConfig.CLIENT.graphics.saturationMultiplier.get().floatValue();
|
||||
float brightnessMultiplier = LodConfig.CLIENT.graphics.brightnessMultiplier.get().floatValue();
|
||||
|
||||
if (saturationMultiplier != 1 || brightnessMultiplier != 1)
|
||||
{
|
||||
|
||||
@@ -28,9 +28,9 @@ import java.util.function.Supplier;
|
||||
|
||||
import com.seibel.lod.builders.LodBuilder;
|
||||
import com.seibel.lod.builders.LodBuilderConfig;
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.DistanceGenerationMode;
|
||||
import com.seibel.lod.enums.LodDetail;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.objects.LodDimension;
|
||||
import com.seibel.lod.proxy.ClientProxy;
|
||||
import com.seibel.lod.render.LodRenderer;
|
||||
@@ -74,7 +74,7 @@ import net.minecraftforge.common.WorldWorkerManager.IWorker;
|
||||
*/
|
||||
public class LodNodeGenWorker implements IWorker
|
||||
{
|
||||
public static ExecutorService genThreads = Executors.newFixedThreadPool(LodConfig.CLIENT.numberOfWorldGenerationThreads.get(), new LodThreadFactory(LodNodeGenWorker.class.getSimpleName()));
|
||||
public static ExecutorService genThreads = Executors.newFixedThreadPool(LodConfig.CLIENT.threading.numberOfWorldGenerationThreads.get(), new LodThreadFactory(LodNodeGenWorker.class.getSimpleName()));
|
||||
|
||||
private boolean threadStarted = false;
|
||||
private LodChunkGenThread thread;
|
||||
@@ -119,7 +119,7 @@ public class LodNodeGenWorker implements IWorker
|
||||
{
|
||||
if (!threadStarted)
|
||||
{
|
||||
if (LodConfig.CLIENT.distanceGenerationMode.get() == DistanceGenerationMode.SERVER)
|
||||
if (LodConfig.CLIENT.worldGenerator.distanceGenerationMode.get() == DistanceGenerationMode.SERVER)
|
||||
{
|
||||
// if we are using SERVER generation that has to be done
|
||||
// synchronously to prevent crashing and harmful
|
||||
@@ -448,7 +448,7 @@ public class LodNodeGenWorker implements IWorker
|
||||
}
|
||||
}
|
||||
|
||||
boolean allowUnstableFeatures = LodConfig.CLIENT.allowUnstableFeatureGeneration.get();
|
||||
boolean allowUnstableFeatures = LodConfig.CLIENT.worldGenerator.allowUnstableFeatureGeneration.get();
|
||||
|
||||
// generate all the features related to this chunk.
|
||||
// this may or may not be thread safe
|
||||
@@ -636,7 +636,7 @@ public class LodNodeGenWorker implements IWorker
|
||||
{
|
||||
genThreads.shutdownNow();
|
||||
}
|
||||
genThreads = Executors.newFixedThreadPool(LodConfig.CLIENT.numberOfWorldGenerationThreads.get(), new LodThreadFactory(LodNodeGenWorker.class.getSimpleName()));
|
||||
genThreads = Executors.newFixedThreadPool(LodConfig.CLIENT.threading.numberOfWorldGenerationThreads.get(), new LodThreadFactory(LodNodeGenWorker.class.getSimpleName()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
|
||||
import com.seibel.lod.builders.GenerationRequest;
|
||||
import com.seibel.lod.builders.LodBuilder;
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.DistanceGenerationMode;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.objects.LodDimension;
|
||||
import com.seibel.lod.objects.LevelPos.LevelPos;
|
||||
import com.seibel.lod.render.LodRenderer;
|
||||
@@ -93,7 +93,7 @@ public class LodWorldGenerator
|
||||
*/
|
||||
public void queueGenerationRequests(LodDimension lodDim, LodRenderer renderer, LodBuilder lodBuilder)
|
||||
{
|
||||
if (LodConfig.CLIENT.distanceGenerationMode.get() != DistanceGenerationMode.NONE
|
||||
if (LodConfig.CLIENT.worldGenerator.distanceGenerationMode.get() != DistanceGenerationMode.NONE
|
||||
&& !generatorThreadRunning
|
||||
&& mc.hasSingleplayerServer())
|
||||
{
|
||||
@@ -101,7 +101,7 @@ public class LodWorldGenerator
|
||||
generatorThreadRunning = true;
|
||||
|
||||
// just in case the config changed
|
||||
maxChunkGenRequests = LodConfig.CLIENT.numberOfWorldGenerationThreads.get() * 8;
|
||||
maxChunkGenRequests = LodConfig.CLIENT.threading.numberOfWorldGenerationThreads.get() * 8;
|
||||
|
||||
Thread generatorThread = new Thread(() ->
|
||||
{
|
||||
|
||||
+154
-84
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.seibel.lod.handlers;
|
||||
package com.seibel.lod.config;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
@@ -44,41 +44,52 @@ import net.minecraftforge.fml.config.ModConfig;
|
||||
* This handles any configuration the user has access to.
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 8-30-2021
|
||||
* @version 9-1-2021
|
||||
*/
|
||||
@Mod.EventBusSubscriber
|
||||
public class LodConfig
|
||||
{
|
||||
// TODO break this up into multiple classes,
|
||||
// there are way to many options here
|
||||
public static class Client
|
||||
{
|
||||
public final Graphics graphics;
|
||||
public final WorldGenerator worldGenerator;
|
||||
public final Threading threading;
|
||||
public final Debugging debugging;
|
||||
public final Buffers buffers;
|
||||
|
||||
public Client(ForgeConfigSpec.Builder builder)
|
||||
{
|
||||
builder.push("client");
|
||||
{
|
||||
graphics = new Graphics(builder);
|
||||
worldGenerator = new WorldGenerator(builder);
|
||||
threading = new Threading(builder);
|
||||
debugging = new Debugging(builder);
|
||||
buffers = new Buffers(builder);
|
||||
}
|
||||
builder.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//================//
|
||||
// Client Configs //
|
||||
//================//
|
||||
|
||||
public static class Graphics
|
||||
{
|
||||
public ForgeConfigSpec.BooleanValue drawLODs;
|
||||
|
||||
public ForgeConfigSpec.EnumValue<FogDistance> fogDistance;
|
||||
|
||||
public ForgeConfigSpec.EnumValue<FogDrawOverride> fogDrawOverride;
|
||||
|
||||
public ForgeConfigSpec.EnumValue<DebugMode> debugMode;
|
||||
|
||||
public ForgeConfigSpec.BooleanValue enableDebugKeybinding;
|
||||
|
||||
public ForgeConfigSpec.EnumValue<LodTemplate> lodTemplate;
|
||||
|
||||
public ForgeConfigSpec.EnumValue<LodDetail> maxDrawDetail;
|
||||
public ForgeConfigSpec.EnumValue<LodDetail> maxGenerationDetail;
|
||||
|
||||
public ForgeConfigSpec.EnumValue<DistanceGenerationMode> distanceGenerationMode;
|
||||
|
||||
public ForgeConfigSpec.BooleanValue allowUnstableFeatureGeneration;
|
||||
|
||||
public ForgeConfigSpec.IntValue numberOfWorldGenerationThreads;
|
||||
public ForgeConfigSpec.IntValue numberOfBufferBuilderThreads;
|
||||
|
||||
public ForgeConfigSpec.EnumValue<ShadingMode> shadingMode;
|
||||
|
||||
public ForgeConfigSpec.EnumValue<DistanceCalculatorType> lodDistanceCalculatorType;
|
||||
|
||||
public ForgeConfigSpec.IntValue lodQuality;
|
||||
|
||||
public ForgeConfigSpec.IntValue lodChunkRenderDistance;
|
||||
@@ -86,14 +97,10 @@ public class LodConfig
|
||||
public ForgeConfigSpec.DoubleValue brightnessMultiplier;
|
||||
public ForgeConfigSpec.DoubleValue saturationMultiplier;
|
||||
|
||||
public ForgeConfigSpec.IntValue bufferRebuildPlayerMoveTimeout;
|
||||
public ForgeConfigSpec.IntValue bufferRebuildChunkChangeTimeout;
|
||||
public ForgeConfigSpec.IntValue bufferRebuildLodChangeTimeout;
|
||||
|
||||
|
||||
Client(ForgeConfigSpec.Builder builder)
|
||||
Graphics(ForgeConfigSpec.Builder builder)
|
||||
{
|
||||
builder.comment(ModInfo.MODNAME + " configuration settings").push("client");
|
||||
builder.comment("These settings control how the LODs look.").push(this.getClass().getSimpleName());
|
||||
|
||||
drawLODs = builder
|
||||
.comment("\n\n"
|
||||
@@ -118,18 +125,6 @@ public class LodConfig
|
||||
+ " " + FogDrawOverride.ALWAYS_DRAW_FOG_FANCY.toString() + ": Always draw fancy fog on the LODs (if your graphics card supports it) \n")
|
||||
.defineEnum("fogDrawOverride", FogDrawOverride.USE_OPTIFINE_FOG_SETTING);
|
||||
|
||||
debugMode = builder
|
||||
.comment("\n\n"
|
||||
+ " " + DebugMode.OFF.toString() + ": LODs will draw with their normal colors. \n"
|
||||
+ " " + DebugMode.SHOW_DETAIL.toString() + ": LOD colors will be based on their detail. \n"
|
||||
+ " " + DebugMode.SHOW_DETAIL_WIREFRAME.toString() + ": LOD colors will be based on their detail, drawn with wireframe. \n")
|
||||
.defineEnum("debugMode", DebugMode.OFF);
|
||||
|
||||
enableDebugKeybinding = builder
|
||||
.comment("\n\n"
|
||||
+ " If true the F4 key can be used to cycle through the different debug modes. \n")
|
||||
.define("enableDebugKeybinding", false);
|
||||
|
||||
lodTemplate = builder
|
||||
.comment("\n\n"
|
||||
+ " How should the LODs be drawn? \n"
|
||||
@@ -151,6 +146,62 @@ public class LodConfig
|
||||
+ " " + LodDetail.FULL.toString() + ": render 256 LODs for each Chunk. \n")
|
||||
.defineEnum("lodDrawQuality", LodDetail.FULL);
|
||||
|
||||
lodQuality = builder
|
||||
.comment("\n\n"
|
||||
+ " this value is multiplied by 128 and determine \n"
|
||||
+ " how much the quality decrease over distance \n")
|
||||
.defineInRange("lodQuality", 1, 1, 4);
|
||||
|
||||
lodChunkRenderDistance = builder
|
||||
.comment("\n\n"
|
||||
+ " This is the render distance of the mod \n")
|
||||
.defineInRange("lodChunkRenderDistane", 64, 32, 512);
|
||||
|
||||
shadingMode = builder
|
||||
.comment("\n\n"
|
||||
+ " What kind of shading should the LODs have? \n"
|
||||
+ " \n"
|
||||
+ " " + ShadingMode.NONE.toString() + " \n"
|
||||
+ " " + "LODs will have the same lighting on every side. \n"
|
||||
+ " " + "Can make large similarly colored areas hard to differentiate. \n"
|
||||
+ "\n"
|
||||
+ " " + ShadingMode.DARKEN_SIDES.toString() + " \n"
|
||||
+ " " + "LODs will have darker sides and bottoms to simulate Minecraft's flat lighting.")
|
||||
.defineEnum("lightingMode", ShadingMode.DARKEN_SIDES);
|
||||
|
||||
brightnessMultiplier = builder
|
||||
.comment("\n\n"
|
||||
+ " Change how bright LOD colors are. \n"
|
||||
+ " 0 = black \n"
|
||||
+ " 1 = normal color value \n"
|
||||
+ " 2 = washed out colors \n")
|
||||
.defineInRange("brightnessMultiplier", 1.0, 0, 2);
|
||||
|
||||
saturationMultiplier = builder
|
||||
.comment("\n\n"
|
||||
+ " Change how saturated LOD colors are. \n"
|
||||
+ " 0 = black and white \n"
|
||||
+ " 1 = normal saturation \n"
|
||||
+ " 2 = very saturated \n")
|
||||
.defineInRange("saturationMultiplier", 1.0, 0, 2);
|
||||
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
}
|
||||
|
||||
public static class WorldGenerator
|
||||
{
|
||||
public ForgeConfigSpec.EnumValue<LodDetail> maxGenerationDetail;
|
||||
public ForgeConfigSpec.EnumValue<DistanceGenerationMode> distanceGenerationMode;
|
||||
public ForgeConfigSpec.BooleanValue allowUnstableFeatureGeneration;
|
||||
public ForgeConfigSpec.EnumValue<DistanceCalculatorType> lodDistanceCalculatorType;
|
||||
|
||||
|
||||
WorldGenerator(ForgeConfigSpec.Builder builder)
|
||||
{
|
||||
builder.comment("These settings control how LODs outside your normal view range are generated.").push(this.getClass().getSimpleName());
|
||||
|
||||
maxGenerationDetail = builder
|
||||
.comment("\n\n"
|
||||
+ " What is the maximum detail level that LODs should be generated at? \n"
|
||||
@@ -178,17 +229,6 @@ public class LodConfig
|
||||
+ " quadratically to the distance of the player \n")
|
||||
.defineEnum("lodDistanceComputation", DistanceCalculatorType.LINEAR);
|
||||
|
||||
lodQuality = builder
|
||||
.comment("\n\n"
|
||||
+ " this value is multiplied by 128 and determine \n"
|
||||
+ " how much the quality decrease over distance \n")
|
||||
.defineInRange("lodQuality", 1, 1, 4);
|
||||
|
||||
lodChunkRenderDistance = builder
|
||||
.comment("\n\n"
|
||||
+ " This is the render distance of the mod \n")
|
||||
.defineInRange("lodChunkRenderDistane", 64, 32, 512);
|
||||
|
||||
distanceGenerationMode = builder
|
||||
.comment("\n\n"
|
||||
+ " Note: The times listed here are the amount of time it took \n"
|
||||
@@ -256,6 +296,20 @@ public class LodConfig
|
||||
+ " https://gitlab.com/jeseibel/minecraft-lod-mod/-/issues/35 \n")
|
||||
.define("allowUnstableFeatureGeneration", false);
|
||||
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Threading
|
||||
{
|
||||
public ForgeConfigSpec.IntValue numberOfWorldGenerationThreads;
|
||||
public ForgeConfigSpec.IntValue numberOfBufferBuilderThreads;
|
||||
|
||||
Threading(ForgeConfigSpec.Builder builder)
|
||||
{
|
||||
builder.comment("These settings control how many CPU threads the mod uses for different tasks.").push(this.getClass().getSimpleName());
|
||||
|
||||
numberOfWorldGenerationThreads = builder
|
||||
.comment("\n\n"
|
||||
+ " This is how many threads are used when generating LODs outside \n"
|
||||
@@ -271,60 +325,71 @@ public class LodConfig
|
||||
numberOfBufferBuilderThreads = builder
|
||||
.comment("\n\n"
|
||||
+ " This is how many threads are used when building vertex buffers \n"
|
||||
+ " (The things I send to the GPU to draw the LODs). \n"
|
||||
+ " (The things sent to your GPU to draw the LODs). \n"
|
||||
+ " If you experience high CPU useage when NOT generating distant \n"
|
||||
+ " LODs lower this number. \n"
|
||||
+ " LODs, lower this number. \n"
|
||||
+ " \n"
|
||||
+ " The maximum value is the number of processors on your CPU. \n"
|
||||
+ " Requires a restart to take effect. \n")
|
||||
.defineInRange("numberOfBufferBuilderThreads", Runtime.getRuntime().availableProcessors(), 1, Runtime.getRuntime().availableProcessors());
|
||||
|
||||
shadingMode = builder
|
||||
.comment("\n\n"
|
||||
+ " What kind of shading should the LODs have? \n"
|
||||
+ " \n"
|
||||
+ " " + ShadingMode.NONE.toString() + " \n"
|
||||
+ " " + "LODs will have the same lighting on every side. \n"
|
||||
+ " " + "Can make large similarly colored areas hard to differentiate. \n"
|
||||
+ "/n"
|
||||
+ " " + ShadingMode.DARKEN_SIDES.toString() + " \n"
|
||||
+ " " + "LODs will have darker sides and bottoms to simulate Minecraft's flat lighting.")
|
||||
.defineEnum("lightingMode", ShadingMode.DARKEN_SIDES);
|
||||
builder.pop();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Debugging
|
||||
{
|
||||
public ForgeConfigSpec.EnumValue<DebugMode> debugMode;
|
||||
public ForgeConfigSpec.BooleanValue enableDebugKeybinding;
|
||||
|
||||
Debugging(ForgeConfigSpec.Builder builder)
|
||||
{
|
||||
builder.comment("These settings can be used by to look for bugs, or see how certain parts of the mod are working.").push(this.getClass().getSimpleName());
|
||||
|
||||
brightnessMultiplier = builder
|
||||
debugMode = builder
|
||||
.comment("\n\n"
|
||||
+ " Change how bright LOD colors are. \n"
|
||||
+ " 0 = black \n"
|
||||
+ " 1 = normal color value \n"
|
||||
+ " 2 = washed out colors \n")
|
||||
.defineInRange("brightnessMultiplier", 1.0, 0, 2);
|
||||
+ " " + DebugMode.OFF.toString() + ": LODs will draw with their normal colors. \n"
|
||||
+ " " + DebugMode.SHOW_DETAIL.toString() + ": LOD colors will be based on their detail. \n"
|
||||
+ " " + DebugMode.SHOW_DETAIL_WIREFRAME.toString() + ": LOD colors will be based on their detail, drawn with wireframe. \n")
|
||||
.defineEnum("debugMode", DebugMode.OFF);
|
||||
|
||||
saturationMultiplier = builder
|
||||
enableDebugKeybinding = builder
|
||||
.comment("\n\n"
|
||||
+ " Change how saturated LOD colors are. \n"
|
||||
+ " 0 = black and white \n"
|
||||
+ " 1 = normal saturation \n"
|
||||
+ " 2 = very saturated \n")
|
||||
.defineInRange("saturationMultiplier", 1.0, 0, 2);
|
||||
+ " If true the F4 key can be used to cycle through the different debug modes. \n")
|
||||
.define("enableDebugKeybinding", false);
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Buffers
|
||||
{
|
||||
public ForgeConfigSpec.IntValue bufferRebuildPlayerMoveTimeout;
|
||||
public ForgeConfigSpec.IntValue bufferRebuildChunkChangeTimeout;
|
||||
public ForgeConfigSpec.IntValue bufferRebuildLodChangeTimeout;
|
||||
|
||||
Buffers(ForgeConfigSpec.Builder builder)
|
||||
{
|
||||
builder.comment("These settings affect when Vertex Buffers are built.").push(this.getClass().getSimpleName());
|
||||
|
||||
bufferRebuildPlayerMoveTimeout = builder
|
||||
.comment("\n\n"
|
||||
+ " How long in milliseconds should we wait to \n"
|
||||
+ " rebuild the buffers when the player moves \n"
|
||||
+ " rebuild the vertex buffers when the player moves \n"
|
||||
+ " a chunk or more? \n")
|
||||
.defineInRange("bufferRebuildPlayerMoveTimeout", 2000, 1, 60000);
|
||||
|
||||
bufferRebuildChunkChangeTimeout = builder
|
||||
.comment("\n\n"
|
||||
+ " How long in milliseconds should we wait to \n"
|
||||
+ " rebuild the buffers when the vanilla rendered \n"
|
||||
+ " rebuild the vertex buffers when the vanilla rendered \n"
|
||||
+ " chunks change? \n")
|
||||
.defineInRange("bufferRebuildChunkChangeTimeout", 1000, 1, 60000);
|
||||
|
||||
bufferRebuildLodChangeTimeout = builder
|
||||
.comment("\n\n"
|
||||
+ " How long in milliseconds should we wait to \n"
|
||||
+ " rebuild the buffers when the LOD regions change? \n")
|
||||
+ " rebuild the vertex buffers when the LOD regions change? \n")
|
||||
.defineInRange("bufferRebuildLodChangeTimeout", 5000, 1, 60000);
|
||||
|
||||
|
||||
@@ -332,27 +397,32 @@ public class LodConfig
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@link Path} to the configuration file of this mod
|
||||
*/
|
||||
private static final Path CONFIG_PATH = Paths.get("config", ModInfo.MODID + ".toml");
|
||||
|
||||
public static final ForgeConfigSpec clientSpec;
|
||||
public static final ForgeConfigSpec CLIENT_SPEC;
|
||||
public static final Client CLIENT;
|
||||
|
||||
static
|
||||
{
|
||||
final Pair<Client, ForgeConfigSpec> specPair = new ForgeConfigSpec.Builder().configure(Client::new);
|
||||
clientSpec = specPair.getRight();
|
||||
CLIENT_SPEC = specPair.getRight();
|
||||
CLIENT = specPair.getLeft();
|
||||
|
||||
// setup the config file
|
||||
CommentedFileConfig config = CommentedFileConfig.builder(CONFIG_PATH)
|
||||
CommentedFileConfig clientConfig = CommentedFileConfig.builder(CONFIG_PATH)
|
||||
.writingMode(WritingMode.REPLACE)
|
||||
.build();
|
||||
config.load();
|
||||
config.save();
|
||||
clientSpec.setConfig(config);
|
||||
clientConfig.load();
|
||||
clientConfig.save();
|
||||
CLIENT_SPEC.setConfig(clientConfig);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -24,7 +24,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.seibel.lod.LodMain;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
@@ -56,7 +56,7 @@ public class MixinWorldRenderer
|
||||
{
|
||||
// only render if LODs are enabled and
|
||||
// only render before solid blocks
|
||||
if (LodConfig.CLIENT.drawLODs.get() && renderType.equals(RenderType.solid()))
|
||||
if (LodConfig.CLIENT.graphics.drawLODs.get() && renderType.equals(RenderType.solid()))
|
||||
LodMain.client_proxy.renderLods(previousPartialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.util.concurrent.Executors;
|
||||
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.DistanceGenerationMode;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.handlers.LodDimensionFileHandler;
|
||||
import com.seibel.lod.objects.LevelPos.LevelPos;
|
||||
import com.seibel.lod.util.DetailDistanceUtil;
|
||||
@@ -374,7 +374,7 @@ public class LodDimension
|
||||
*/
|
||||
public void treeGenerator(int playerPosX, int playerPosZ)
|
||||
{
|
||||
DistanceGenerationMode generationMode = LodConfig.CLIENT.distanceGenerationMode.get();
|
||||
DistanceGenerationMode generationMode = LodConfig.CLIENT.worldGenerator.distanceGenerationMode.get();
|
||||
ChunkPos newPlayerChunk = (new LevelPos((byte) 0, playerPosX, playerPosZ)).getChunkPos();
|
||||
|
||||
if (lastGenChunk == null)
|
||||
|
||||
@@ -25,13 +25,13 @@ import com.seibel.lod.builders.LodBufferBuilder;
|
||||
import com.seibel.lod.builders.LodBuilder;
|
||||
import com.seibel.lod.builders.worldGeneration.LodNodeGenWorker;
|
||||
import com.seibel.lod.builders.worldGeneration.LodWorldGenerator;
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.DistanceCalculatorType;
|
||||
import com.seibel.lod.enums.DistanceGenerationMode;
|
||||
import com.seibel.lod.enums.FogDistance;
|
||||
import com.seibel.lod.enums.FogDrawOverride;
|
||||
import com.seibel.lod.enums.LodDetail;
|
||||
import com.seibel.lod.enums.ShadingMode;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.objects.LodDimension;
|
||||
import com.seibel.lod.objects.LodWorld;
|
||||
import com.seibel.lod.objects.RegionPos;
|
||||
@@ -142,7 +142,7 @@ public class ClientProxy
|
||||
// these can't be set until after the buffers are built (in renderer.drawLODs)
|
||||
// otherwise the buffers may be set to the wrong size, or not changed at all
|
||||
previousChunkRenderDistance = mc.options.renderDistance;
|
||||
previousLodRenderDistance = LodConfig.CLIENT.lodChunkRenderDistance.get();
|
||||
previousLodRenderDistance = LodConfig.CLIENT.graphics.lodChunkRenderDistance.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -158,26 +158,26 @@ public class ClientProxy
|
||||
//LodConfig.CLIENT.drawLODs.set(true);
|
||||
//LodConfig.CLIENT.debugMode.set(true);
|
||||
|
||||
LodConfig.CLIENT.maxDrawDetail.set(LodDetail.FULL);
|
||||
LodConfig.CLIENT.maxGenerationDetail.set(LodDetail.FULL);
|
||||
LodConfig.CLIENT.graphics.maxDrawDetail.set(LodDetail.FULL);
|
||||
LodConfig.CLIENT.worldGenerator.maxGenerationDetail.set(LodDetail.FULL);
|
||||
|
||||
LodConfig.CLIENT.fogDistance.set(FogDistance.FAR);
|
||||
LodConfig.CLIENT.fogDrawOverride.set(FogDrawOverride.ALWAYS_DRAW_FOG_FANCY);
|
||||
LodConfig.CLIENT.shadingMode.set(ShadingMode.DARKEN_SIDES);
|
||||
LodConfig.CLIENT.brightnessMultiplier.set(1.0);
|
||||
LodConfig.CLIENT.saturationMultiplier.set(1.0);
|
||||
LodConfig.CLIENT.graphics.fogDistance.set(FogDistance.FAR);
|
||||
LodConfig.CLIENT.graphics.fogDrawOverride.set(FogDrawOverride.ALWAYS_DRAW_FOG_FANCY);
|
||||
LodConfig.CLIENT.graphics.shadingMode.set(ShadingMode.DARKEN_SIDES);
|
||||
LodConfig.CLIENT.graphics.brightnessMultiplier.set(1.0);
|
||||
LodConfig.CLIENT.graphics.saturationMultiplier.set(1.0);
|
||||
|
||||
LodConfig.CLIENT.distanceGenerationMode.set(DistanceGenerationMode.SURFACE);
|
||||
LodConfig.CLIENT.lodChunkRenderDistance.set(256);
|
||||
LodConfig.CLIENT.lodDistanceCalculatorType.set(DistanceCalculatorType.LINEAR);
|
||||
LodConfig.CLIENT.lodQuality.set(3);
|
||||
LodConfig.CLIENT.allowUnstableFeatureGeneration.set(false);
|
||||
LodConfig.CLIENT.worldGenerator.distanceGenerationMode.set(DistanceGenerationMode.SURFACE);
|
||||
LodConfig.CLIENT.graphics.lodChunkRenderDistance.set(256);
|
||||
LodConfig.CLIENT.worldGenerator.lodDistanceCalculatorType.set(DistanceCalculatorType.LINEAR);
|
||||
LodConfig.CLIENT.graphics.lodQuality.set(3);
|
||||
LodConfig.CLIENT.worldGenerator.allowUnstableFeatureGeneration.set(false);
|
||||
|
||||
LodConfig.CLIENT.bufferRebuildPlayerMoveTimeout.set(2000); // 2000
|
||||
LodConfig.CLIENT.bufferRebuildChunkChangeTimeout.set(1000); // 1000
|
||||
LodConfig.CLIENT.bufferRebuildLodChangeTimeout.set(50); // 5000
|
||||
LodConfig.CLIENT.buffers.bufferRebuildPlayerMoveTimeout.set(2000); // 2000
|
||||
LodConfig.CLIENT.buffers.bufferRebuildChunkChangeTimeout.set(1000); // 1000
|
||||
LodConfig.CLIENT.buffers.bufferRebuildLodChangeTimeout.set(50); // 5000
|
||||
|
||||
LodConfig.CLIENT.enableDebugKeybinding.set(true);
|
||||
LodConfig.CLIENT.debugging.enableDebugKeybinding.set(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -261,10 +261,10 @@ public class ClientProxy
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(InputEvent.KeyInputEvent event)
|
||||
{
|
||||
if(LodConfig.CLIENT.enableDebugKeybinding.get()
|
||||
if(LodConfig.CLIENT.debugging.enableDebugKeybinding.get()
|
||||
&& event.getKey() == GLFW.GLFW_KEY_F4 && event.getAction() == GLFW.GLFW_PRESS)
|
||||
{
|
||||
LodConfig.CLIENT.debugMode.set(LodConfig.CLIENT.debugMode.get().getNext());
|
||||
LodConfig.CLIENT.debugging.debugMode.set(LodConfig.CLIENT.debugging.debugMode.get().getNext());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ public class ClientProxy
|
||||
private void viewDistanceChangedEvent()
|
||||
{
|
||||
// calculate how wide the dimension(s) should be in regions
|
||||
int chunksWide = LodConfig.CLIENT.lodChunkRenderDistance.get() * 2 + 1;
|
||||
int chunksWide = LodConfig.CLIENT.graphics.lodChunkRenderDistance.get() * 2 + 1;
|
||||
int newWidth = (int) Math.ceil(chunksWide / (float) LodUtil.REGION_WIDTH_IN_CHUNKS);
|
||||
newWidth = (newWidth % 2 == 0) ? (newWidth += 1) : (newWidth += 2); // make sure we have a odd number of regions
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.nio.FloatBuffer;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.seibel.lod.util.DetailDistanceUtil;
|
||||
import org.lwjgl.opengl.GL;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.NVFogDistance;
|
||||
@@ -32,17 +31,18 @@ import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.seibel.lod.builders.LodBufferBuilder;
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.DebugMode;
|
||||
import com.seibel.lod.enums.FogDistance;
|
||||
import com.seibel.lod.enums.FogDrawOverride;
|
||||
import com.seibel.lod.enums.FogQuality;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.handlers.ReflectionHandler;
|
||||
import com.seibel.lod.objects.LodDimension;
|
||||
import com.seibel.lod.objects.NearFarFogSettings;
|
||||
import com.seibel.lod.objects.RegionPos;
|
||||
import com.seibel.lod.objects.LevelPos.LevelPos;
|
||||
import com.seibel.lod.proxy.ClientProxy;
|
||||
import com.seibel.lod.util.DetailDistanceUtil;
|
||||
import com.seibel.lod.util.LodUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -60,7 +60,6 @@ import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.vector.Matrix4f;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraft.util.math.vector.Vector3f;
|
||||
import org.lwjgl.system.CallbackI;
|
||||
|
||||
|
||||
/**
|
||||
@@ -244,7 +243,7 @@ public class LodRenderer
|
||||
|
||||
// set the required open GL settings
|
||||
|
||||
if (LodConfig.CLIENT.debugMode.get() == DebugMode.SHOW_DETAIL_WIREFRAME)
|
||||
if (LodConfig.CLIENT.debugging.debugMode.get() == DebugMode.SHOW_DETAIL_WIREFRAME)
|
||||
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
|
||||
else
|
||||
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
|
||||
@@ -266,7 +265,7 @@ public class LodRenderer
|
||||
Matrix4f modelViewMatrix = generateModelViewMatrix(partialTicks);
|
||||
|
||||
// required for setupFog and setupProjectionMatrix
|
||||
farPlaneBlockDistance = LodConfig.CLIENT.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH;
|
||||
farPlaneBlockDistance = LodConfig.CLIENT.graphics.lodChunkRenderDistance.get() * LodUtil.CHUNK_WIDTH;
|
||||
|
||||
setupProjectionMatrix(partialTicks);
|
||||
setupLighting(lodDim, partialTicks);
|
||||
@@ -663,7 +662,7 @@ public class LodRenderer
|
||||
|
||||
|
||||
FogQuality quality = reflectionHandler.getFogQuality();
|
||||
FogDrawOverride override = LodConfig.CLIENT.fogDrawOverride.get();
|
||||
FogDrawOverride override = LodConfig.CLIENT.graphics.fogDrawOverride.get();
|
||||
|
||||
|
||||
if (quality == FogQuality.OFF)
|
||||
@@ -707,7 +706,7 @@ public class LodRenderer
|
||||
fogSettings.near.quality = FogQuality.FANCY;
|
||||
fogSettings.far.quality = FogQuality.FANCY;
|
||||
|
||||
switch (LodConfig.CLIENT.fogDistance.get())
|
||||
switch (LodConfig.CLIENT.graphics.fogDistance.get())
|
||||
{
|
||||
case NEAR_AND_FAR:
|
||||
fogSettings.near.distance = FogDistance.NEAR;
|
||||
@@ -734,7 +733,7 @@ public class LodRenderer
|
||||
// fog, since the LODs are separated into a near
|
||||
// and far portion; and fast fog is rendered from the
|
||||
// frustrum's perspective instead of the camera
|
||||
switch (LodConfig.CLIENT.fogDistance.get())
|
||||
switch (LodConfig.CLIENT.graphics.fogDistance.get())
|
||||
{
|
||||
case NEAR_AND_FAR:
|
||||
fogSettings.near.distance = FogDistance.NEAR;
|
||||
@@ -778,23 +777,23 @@ public class LodRenderer
|
||||
// full regens //
|
||||
//=============//
|
||||
// check if the view distance changed
|
||||
if (ClientProxy.previousLodRenderDistance != LodConfig.CLIENT.lodChunkRenderDistance.get()
|
||||
if (ClientProxy.previousLodRenderDistance != LodConfig.CLIENT.graphics.lodChunkRenderDistance.get()
|
||||
|| mc.options.renderDistance != prevRenderDistance
|
||||
|| prevFogDistance != LodConfig.CLIENT.fogDistance.get())
|
||||
|| prevFogDistance != LodConfig.CLIENT.graphics.fogDistance.get())
|
||||
{
|
||||
DetailDistanceUtil.updateSettings();
|
||||
fullRegen = true;
|
||||
previousPos.changeParameters((byte) 4, mc.player.xChunk, mc.player.zChunk);
|
||||
prevFogDistance = LodConfig.CLIENT.fogDistance.get();
|
||||
prevFogDistance = LodConfig.CLIENT.graphics.fogDistance.get();
|
||||
prevRenderDistance = mc.options.renderDistance;
|
||||
//should use this when it's ready
|
||||
vanillaRenderedChunks = new boolean[renderDistance*2+2][renderDistance*2+2];
|
||||
}
|
||||
|
||||
// did the user change the debug setting?
|
||||
if (LodConfig.CLIENT.debugMode.get() != previousDebugMode)
|
||||
if (LodConfig.CLIENT.debugging.debugMode.get() != previousDebugMode)
|
||||
{
|
||||
previousDebugMode = LodConfig.CLIENT.debugMode.get();
|
||||
previousDebugMode = LodConfig.CLIENT.debugging.debugMode.get();
|
||||
fullRegen = true;
|
||||
}
|
||||
|
||||
@@ -802,7 +801,7 @@ public class LodRenderer
|
||||
long newTime = System.currentTimeMillis();
|
||||
|
||||
// check if the player has moved
|
||||
if (newTime - prevPlayerPosTime > LodConfig.CLIENT.bufferRebuildPlayerMoveTimeout.get())
|
||||
if (newTime - prevPlayerPosTime > LodConfig.CLIENT.buffers.bufferRebuildPlayerMoveTimeout.get())
|
||||
{
|
||||
if (previousPos.detailLevel == 0
|
||||
|| mc.player.xChunk != previousPos.posX
|
||||
@@ -824,7 +823,7 @@ public class LodRenderer
|
||||
|
||||
|
||||
// check if the vanilla rendered chunks changed
|
||||
if (newTime - prevVanillaChunkTime > LodConfig.CLIENT.bufferRebuildChunkChangeTimeout.get())
|
||||
if (newTime - prevVanillaChunkTime > LodConfig.CLIENT.buffers.bufferRebuildChunkChangeTimeout.get())
|
||||
{
|
||||
if (vanillaRenderedChunksChanged)
|
||||
{
|
||||
@@ -837,7 +836,7 @@ public class LodRenderer
|
||||
|
||||
|
||||
// check if there is any newly generated terrain to show
|
||||
if (newTime - prevChunkTime > LodConfig.CLIENT.bufferRebuildLodChangeTimeout.get())
|
||||
if (newTime - prevChunkTime > LodConfig.CLIENT.buffers.bufferRebuildLodChangeTimeout.get())
|
||||
{
|
||||
if (lodDim.regenDimension)
|
||||
{
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
package com.seibel.lod.render;
|
||||
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.LodTemplate;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.util.LodUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -97,7 +97,7 @@ public class RenderUtil
|
||||
{
|
||||
// calculate the max amount of buffer memory needed (in bytes)
|
||||
return LodUtil.REGION_WIDTH_IN_CHUNKS * LodUtil.REGION_WIDTH_IN_CHUNKS *
|
||||
LodConfig.CLIENT.lodTemplate.get().getBufferMemoryForSingleLod();
|
||||
LodConfig.CLIENT.graphics.lodTemplate.get().getBufferMemoryForSingleLod();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.seibel.lod.util;
|
||||
|
||||
import com.ibm.icu.util.IslamicCalendar;
|
||||
import com.seibel.lod.enums.DistanceCalculatorType;
|
||||
import com.seibel.lod.config.LodConfig;
|
||||
import com.seibel.lod.enums.DistanceGenerationMode;
|
||||
import com.seibel.lod.enums.LodCorner;
|
||||
import com.seibel.lod.enums.LodDetail;
|
||||
import com.seibel.lod.handlers.LodConfig;
|
||||
import com.seibel.lod.objects.RegionPos;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class DetailDistanceUtil
|
||||
@@ -14,11 +12,11 @@ public class DetailDistanceUtil
|
||||
private static double genMultiplier = 1.0;
|
||||
private static double treeGenMultiplier = 1.0;
|
||||
private static double treeCutMultiplier = 1.0;
|
||||
private static int minGenDetail = LodConfig.CLIENT.maxGenerationDetail.get().detailLevel;
|
||||
private static int minDrawDetail = Math.max(LodConfig.CLIENT.maxDrawDetail.get().detailLevel,LodConfig.CLIENT.maxGenerationDetail.get().detailLevel);
|
||||
private static int minGenDetail = LodConfig.CLIENT.worldGenerator.maxGenerationDetail.get().detailLevel;
|
||||
private static int minDrawDetail = Math.max(LodConfig.CLIENT.graphics.maxDrawDetail.get().detailLevel,LodConfig.CLIENT.worldGenerator.maxGenerationDetail.get().detailLevel);
|
||||
private static int maxDetail = LodUtil.REGION_DETAIL_LEVEL + 1;
|
||||
private static int minDistance = 0;
|
||||
private static int maxDistance = LodConfig.CLIENT.lodChunkRenderDistance.get() * 16 * 2;
|
||||
private static int maxDistance = LodConfig.CLIENT.graphics.lodChunkRenderDistance.get() * 16 * 2;
|
||||
private static int base = 2;
|
||||
private static double logBase = Math.log(2);
|
||||
|
||||
@@ -37,9 +35,9 @@ public class DetailDistanceUtil
|
||||
|
||||
|
||||
public static void updateSettings(){
|
||||
minGenDetail = LodConfig.CLIENT.maxGenerationDetail.get().detailLevel;
|
||||
minDrawDetail = Math.max(LodConfig.CLIENT.maxDrawDetail.get().detailLevel,LodConfig.CLIENT.maxGenerationDetail.get().detailLevel);
|
||||
maxDistance = LodConfig.CLIENT.lodChunkRenderDistance.get() * 16 * 2;
|
||||
minGenDetail = LodConfig.CLIENT.worldGenerator.maxGenerationDetail.get().detailLevel;
|
||||
minDrawDetail = Math.max(LodConfig.CLIENT.graphics.maxDrawDetail.get().detailLevel,LodConfig.CLIENT.worldGenerator.maxGenerationDetail.get().detailLevel);
|
||||
maxDistance = LodConfig.CLIENT.graphics.lodChunkRenderDistance.get() * 16 * 2;
|
||||
}
|
||||
|
||||
public static int getDistanceRendering(int detail)
|
||||
@@ -52,13 +50,13 @@ public class DetailDistanceUtil
|
||||
return maxDistance;
|
||||
if (detail == maxDetail + 1)
|
||||
return maxDistance;
|
||||
switch (LodConfig.CLIENT.lodDistanceCalculatorType.get())
|
||||
switch (LodConfig.CLIENT.worldGenerator.lodDistanceCalculatorType.get())
|
||||
{
|
||||
case LINEAR:
|
||||
initial = LodConfig.CLIENT.lodQuality.get() * 128;
|
||||
initial = LodConfig.CLIENT.graphics.lodQuality.get() * 128;
|
||||
return (detail * initial);
|
||||
case QUADRATIC:
|
||||
initial = LodConfig.CLIENT.lodQuality.get() * 128;
|
||||
initial = LodConfig.CLIENT.graphics.lodQuality.get() * 128;
|
||||
return (int) (Math.pow(base, detail) * initial);
|
||||
case RENDER_DEPENDANT:
|
||||
int realRenderDistance = Minecraft.getInstance().options.renderDistance * 16;
|
||||
@@ -83,14 +81,14 @@ public class DetailDistanceUtil
|
||||
detail = (byte) minDetail;
|
||||
if (distance > maxDistance)
|
||||
detail = (byte) (maxDetail-1);
|
||||
switch (LodConfig.CLIENT.lodDistanceCalculatorType.get())
|
||||
switch (LodConfig.CLIENT.worldGenerator.lodDistanceCalculatorType.get())
|
||||
{
|
||||
case LINEAR:
|
||||
initial = LodConfig.CLIENT.lodQuality.get() * 128;
|
||||
initial = LodConfig.CLIENT.graphics.lodQuality.get() * 128;
|
||||
detail = (byte) Math.floorDiv(distance, initial);
|
||||
break;
|
||||
case QUADRATIC:
|
||||
initial = LodConfig.CLIENT.lodQuality.get() * 128;
|
||||
initial = LodConfig.CLIENT.graphics.lodQuality.get() * 128;
|
||||
detail = (byte) (Math.log(Math.floorDiv(distance, initial))/logBase);
|
||||
break;
|
||||
case RENDER_DEPENDANT:
|
||||
@@ -144,7 +142,7 @@ public class DetailDistanceUtil
|
||||
|
||||
public static DistanceGenerationMode getDistanceGenerationMode(int detail)
|
||||
{
|
||||
return LodConfig.CLIENT.distanceGenerationMode.get();
|
||||
return LodConfig.CLIENT.worldGenerator.distanceGenerationMode.get();
|
||||
}
|
||||
|
||||
public static byte getLodDrawDetail(int detail)
|
||||
|
||||
Reference in New Issue
Block a user