Create pre-release a1.5.1

I made this version so hopefully someone could test if Vivecraft is just ignoring Minecraft's FOV when creating their projection matrices or if they are doing something more complicated.
This commit is contained in:
James Seibel
2021-09-28 22:56:17 -05:00
parent 8f329ac785
commit d59f9dc4c6
6 changed files with 40 additions and 10 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ apply plugin: 'org.spongepowered.mixin'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = 'a1.5.0-pre'
version = 'a1.5.1-pre'
group = 'com.seibel.lod'
archivesBaseName = 'lod_1.16.5'
+1 -1
View File
@@ -28,5 +28,5 @@ public final class ModInfo
public static final String MODID = "lod";
public static final String MODNAME = "LOD";
public static final String MODAPI = "LodAPI";
public static final String VERSION = "a1.5.0-pre";
public static final String VERSION = "a1.5.1-pre";
}
@@ -37,6 +37,7 @@ import com.seibel.lod.enums.HorizontalResolution;
import com.seibel.lod.enums.HorizontalScale;
import com.seibel.lod.enums.LodTemplate;
import com.seibel.lod.enums.VerticalQuality;
import com.seibel.lod.render.LodRenderer.FovTest;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.eventbus.api.SubscribeEvent;
@@ -100,6 +101,8 @@ public class LodConfig
public ForgeConfigSpec.BooleanValue alwaysDrawAtMaxQuality;
public ForgeConfigSpec.EnumValue<FovTest> useFovSetting;
Graphics(ForgeConfigSpec.Builder builder)
{
@@ -162,6 +165,12 @@ public class LodConfig
+ " The mod's render distance, measured in chunks. \n")
.defineInRange("lodChunkRenderDistance", 64, 32, 1024);
useFovSetting = builder
.comment("\n\n"
+ " Experimental text value. \n"
+ " " + FovTest.BOTH + ": is the normal value \n")
.defineEnum("useFovSetting", FovTest.BOTH);
disableDirectionalCulling = builder
.comment("\n\n"
+ " If false LODs that are behind the player's camera \n"
@@ -164,11 +164,13 @@ public class ClientProxy
// remind the developer(s) that the config override is active
if (!configOverrideReminderPrinted)
{
mc.getPlayer().sendMessage(new StringTextComponent("Debug settings enabled!"), mc.getPlayer().getUUID());
//mc.getPlayer().sendMessage(new StringTextComponent("Debug settings enabled!"), mc.getPlayer().getUUID());
mc.getPlayer().sendMessage(new StringTextComponent("LOD experimental build 1.5.1"), mc.getPlayer().getUUID());
mc.getPlayer().sendMessage(new StringTextComponent("Here be dragons!"), mc.getPlayer().getUUID());
configOverrideReminderPrinted = true;
}
// LodConfig.CLIENT.graphics.drawResolution.set(HorizontalResolution.BLOCK);
// LodConfig.CLIENT.worldGenerator.generationResolution.set(HorizontalResolution.BLOCK);
// requires a world restart?
@@ -179,12 +181,12 @@ public class ClientProxy
// LodConfig.CLIENT.graphics.shadingMode.set(ShadingMode.DARKEN_SIDES);
// LodConfig.CLIENT.graphics.brightnessMultiplier.set(1.0);
// LodConfig.CLIENT.graphics.saturationMultiplier.set(1.0);
// LodConfig.CLIENT.worldGenerator.distanceGenerationMode.set(DistanceGenerationMode.SURFACE);
// LodConfig.CLIENT.graphics.lodChunkRenderDistance.set(64);
// LodConfig.CLIENT.worldGenerator.lodDistanceCalculatorType.set(DistanceCalculatorType.LINEAR);
// LodConfig.CLIENT.worldGenerator.allowUnstableFeatureGeneration.set(false);
// LodConfig.CLIENT.buffers.bufferRebuildPlayerMoveTimeout.set(2000); // 2000
// LodConfig.CLIENT.buffers.bufferRebuildChunkChangeTimeout.set(1000); // 1000
// LodConfig.CLIENT.buffers.bufferRebuildLodChangeTimeout.set(5000); // 5000
@@ -65,7 +65,7 @@ import net.minecraft.util.math.vector.Vector3d;
* This is where LODs are draw to the world.
*
* @author James Seibel
* @version 9-23-2021
* @version 9-28-2021
*/
public class LodRenderer
{
@@ -483,6 +483,25 @@ public class LodRenderer
}
/** James added this to test if Vivecraft is not using
* the MC FOV setting or if the problem is deeper */
public enum FovTest
{
LOD_USE_FOV(true, false),
MC_USE_FOV(false, true),
NEITHER(false, false),
BOTH(true, true);
boolean lodProjUseFov;
boolean defaultMcProjUseFov;
private FovTest(boolean newLodProjUseFov, boolean newDefaultMcProjUseFov)
{
lodProjUseFov = newLodProjUseFov;
defaultMcProjUseFov = newDefaultMcProjUseFov;
}
}
/**
* create a new projection matrix and send it over to the GPU
*
@@ -494,14 +513,14 @@ public class LodRenderer
// create the new projection matrix
Matrix4f lodPoj =
Matrix4f.perspective(
getFov(partialTicks, true),
getFov(partialTicks, LodConfig.CLIENT.graphics.useFovSetting.get().lodProjUseFov),
(float) this.mc.getWindow().getScreenWidth() / (float) this.mc.getWindow().getScreenHeight(),
mc.getRenderDistance()/2,
farPlaneBlockDistance * LodUtil.CHUNK_WIDTH * 2 / 4);
// get Minecraft's un-edited projection matrix
// (this is before it is zoomed, distorted, etc.)
Matrix4f defaultMcProj = mc.getGameRenderer().getProjectionMatrix(mc.getGameRenderer().getMainCamera(), partialTicks, true);
Matrix4f defaultMcProj = mc.getGameRenderer().getProjectionMatrix(mc.getGameRenderer().getMainCamera(), partialTicks, LodConfig.CLIENT.graphics.useFovSetting.get().defaultMcProjUseFov);
// true here means use "use fov setting" (probably)
+1 -1
View File
@@ -24,7 +24,7 @@ modId="lod" #mandatory
#// The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
#//${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
#// see the associated build.gradle script for how to populate this completely automatically during a build
version="a1.5.0-pre" #mandatory
version="a1.5.1-pre" #mandatory
#// A display name for the mod
displayName="LOD" #mandatory