From ed95ff8bf792188db2305bc988f2ec0c4e619eb1 Mon Sep 17 00:00:00 2001 From: LAX1DUDE Date: Wed, 14 Jun 2023 19:59:38 -0700 Subject: [PATCH] Update #19 - Removed fast math, fixed water shader --- client_version | 2 +- .../client/gui/GuiVideoSettings.edit.java | 2 +- .../client/settings/GameSettings.edit.java | 23 ++-------- .../net/minecraft/util/Timer.edit.java | 10 +--- .../net/minecraft/world/World.edit.java | 46 +------------------ .../eaglercraft/v1_8/EaglercraftVersion.java | 4 +- .../glsl/deferred/realistic_water_control.fsh | 5 ++ 7 files changed, 17 insertions(+), 75 deletions(-) diff --git a/client_version b/client_version index ae88067..ba80524 100644 --- a/client_version +++ b/client_version @@ -1 +1 @@ -u18 \ No newline at end of file +u19 \ No newline at end of file diff --git a/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.edit.java b/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.edit.java index a15a2d1..66b65e2 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.edit.java +++ b/patches/minecraft/net/minecraft/client/gui/GuiVideoSettings.edit.java @@ -15,7 +15,7 @@ ~ GameSettings.Options.BLOCK_ALTERNATIVES, GameSettings.Options.ENTITY_SHADOWS, GameSettings.Options.FOG, ~ GameSettings.Options.FULLSCREEN, GameSettings.Options.HUD_FPS, GameSettings.Options.HUD_COORDS, ~ GameSettings.Options.HUD_PLAYER, GameSettings.Options.HUD_STATS, GameSettings.Options.HUD_WORLD, -~ GameSettings.Options.HUD_24H, GameSettings.Options.CHUNK_FIX, GameSettings.Options.FAST_MATH }; +~ GameSettings.Options.HUD_24H, GameSettings.Options.CHUNK_FIX }; > CHANGE 11 : 13 @ 11 : 14 diff --git a/patches/minecraft/net/minecraft/client/settings/GameSettings.edit.java b/patches/minecraft/net/minecraft/client/settings/GameSettings.edit.java index 1b2264e..b867fd7 100644 --- a/patches/minecraft/net/minecraft/client/settings/GameSettings.edit.java +++ b/patches/minecraft/net/minecraft/client/settings/GameSettings.edit.java @@ -77,7 +77,7 @@ ~ public int guiScale = 3; -> INSERT 3 : 16 @ 3 +> INSERT 3 : 15 @ 3 + public boolean hudFps = true; + public boolean hudCoords = true; @@ -91,7 +91,6 @@ + public boolean shaders = false; + public boolean shadersAODisable = false; + public EaglerDeferredConfig deferredShaderConf = new EaglerDeferredConfig(); -+ public int fastMath = 1; > CHANGE 1 : 2 @ 1 : 2 @@ -132,7 +131,7 @@ > DELETE 20 @ 20 : 37 -> INSERT 13 : 57 @ 13 +> INSERT 13 : 53 @ 13 + if (parOptions == GameSettings.Options.HUD_FPS) { + this.hudFps = !this.hudFps; @@ -174,10 +173,6 @@ + this.mc.toggleFullscreen(); + } + -+ if (parOptions == GameSettings.Options.FAST_MATH) { -+ this.fastMath = (this.fastMath + parInt1) % 3; -+ } -+ > CHANGE 23 : 24 @ 23 : 34 @@ -246,7 +241,7 @@ > DELETE 11 @ 11 : 19 -> INSERT 9 : 19 @ 9 +> INSERT 9 : 17 @ 9 + } else if (parOptions == GameSettings.Options.FXAA) { + if (this.fxaa == 0) { @@ -256,8 +251,6 @@ + } else { + return s + I18n.format("options.off"); + } -+ } else if (parOptions == GameSettings.Options.FAST_MATH) { -+ return s + I18n.format("options.fastMath." + this.fastMath); > CHANGE 7 : 9 @ 7 : 8 @@ -362,12 +355,7 @@ ~ this.fxaa = (astring[1].equals("true") || astring[1].equals("false")) ? 0 ~ : Integer.parseInt(astring[1]); -> CHANGE 2 : 4 @ 2 : 4 - -~ if (astring[0].equals("fastMath")) { -~ this.fastMath = Integer.parseInt(astring[1]); - -> DELETE 2 @ 2 : 6 +> DELETE 2 @ 2 : 10 > INSERT 6 : 12 @ 6 @@ -401,7 +389,7 @@ > DELETE 13 @ 13 : 24 -> INSERT 5 : 16 @ 5 +> INSERT 5 : 15 @ 5 + printwriter.println("hudFps:" + this.hudFps); + printwriter.println("hudWorld:" + this.hudWorld); @@ -412,7 +400,6 @@ + printwriter.println("chunkFix:" + this.chunkFix); + printwriter.println("fog:" + this.fog); + printwriter.println("fxaa:" + this.fxaa); -+ printwriter.println("fastMath:" + this.fastMath); + printwriter.println("shaders:" + this.shaders); > INSERT 5 : 7 @ 5 diff --git a/patches/minecraft/net/minecraft/util/Timer.edit.java b/patches/minecraft/net/minecraft/util/Timer.edit.java index 8700198..a7578dc 100644 --- a/patches/minecraft/net/minecraft/util/Timer.edit.java +++ b/patches/minecraft/net/minecraft/util/Timer.edit.java @@ -7,14 +7,6 @@ > DELETE 3 @ 3 : 4 -> CHANGE 53 : 60 @ 53 : 54 - -~ int fastMathSetting = Minecraft.getMinecraft().gameSettings.fastMath; -~ if (fastMathSetting > 0) { -~ float f = fastMathSetting == 2 ? 16.0f : 64.0f; -~ this.renderPartialTicks = ((int) (this.elapsedPartialTicks * f) / f); -~ } else { -~ this.renderPartialTicks = this.elapsedPartialTicks; -~ } +> DELETE 52 @ 52 : 53 > EOF diff --git a/patches/minecraft/net/minecraft/world/World.edit.java b/patches/minecraft/net/minecraft/world/World.edit.java index aa78f32..5f80d1a 100644 --- a/patches/minecraft/net/minecraft/world/World.edit.java +++ b/patches/minecraft/net/minecraft/world/World.edit.java @@ -23,15 +23,7 @@ + import com.google.common.collect.Sets; + -> INSERT 8 : 9 @ 8 - -+ import net.minecraft.client.Minecraft; - -> INSERT 4 : 5 @ 4 - -+ import net.minecraft.entity.EntityLivingBase; - -> DELETE 6 @ 6 : 7 +> DELETE 18 @ 18 : 19 > DELETE 12 @ 12 : 27 @@ -91,41 +83,7 @@ ~ return Chunk.getNoSkyLightValue(); -> INSERT 896 : 927 @ 896 - -+ int fastMathSetting = Minecraft.getMinecraft().gameSettings.fastMath; -+ if (fastMathSetting > 0) { -+ double posPrec = fastMathSetting == 2 ? 256.0 : 1024.0; -+ float rotPrec = fastMathSetting == 2 ? 64.0f : 128.0f; -+ double velPrec = fastMathSetting == 2 ? 2048.0 : 4096.0; -+ entityIn.lastTickPosX = (long) (entityIn.lastTickPosX * posPrec) / posPrec; -+ entityIn.lastTickPosY = (long) (entityIn.lastTickPosY * posPrec) / posPrec; -+ entityIn.lastTickPosZ = (long) (entityIn.lastTickPosZ * posPrec) / posPrec; -+ entityIn.prevPosX = (int) (entityIn.prevPosX * posPrec) / posPrec; -+ entityIn.prevPosY = (int) (entityIn.prevPosY * posPrec) / posPrec; -+ entityIn.prevPosZ = (int) (entityIn.prevPosZ * posPrec) / posPrec; -+ entityIn.posX = (int) (entityIn.posX * posPrec) / posPrec; -+ entityIn.posY = (int) (entityIn.posY * posPrec) / posPrec; -+ entityIn.posZ = (int) (entityIn.posZ * posPrec) / posPrec; -+ entityIn.prevRotationPitch = (int) (entityIn.prevRotationPitch * rotPrec) / rotPrec; -+ entityIn.prevRotationYaw = (int) (entityIn.prevRotationYaw * rotPrec) / rotPrec; -+ entityIn.rotationPitch = (int) (entityIn.rotationPitch * rotPrec) / rotPrec; -+ entityIn.rotationYaw = (int) (entityIn.rotationYaw * rotPrec) / rotPrec; -+ if (entityIn instanceof EntityLivingBase) { -+ EntityLivingBase l = (EntityLivingBase) entityIn; -+ l.prevRotationYawHead = (int) (l.prevRotationYawHead * rotPrec) / rotPrec; -+ l.rotationYawHead = (int) (l.rotationYawHead * rotPrec) / rotPrec; -+ l.prevRenderYawOffset = (int) (l.prevRenderYawOffset * rotPrec) / rotPrec; -+ l.renderYawOffset = (int) (l.renderYawOffset * rotPrec) / rotPrec; -+ l.prevRotationPitch = (int) (l.prevRotationPitch * rotPrec) / rotPrec; -+ l.rotationPitch = (int) (l.rotationPitch * rotPrec) / rotPrec; -+ } -+ entityIn.motionX = (int) (entityIn.motionX * velPrec) / velPrec; -+ entityIn.motionY = (int) (entityIn.motionY * velPrec) / velPrec; -+ entityIn.motionZ = (int) (entityIn.motionZ * velPrec) / velPrec; -+ } - -> DELETE 390 @ 390 : 448 +> DELETE 1286 @ 1286 : 1344 > DELETE 40 @ 40 : 64 diff --git a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java index 8b920dc..439fae4 100644 --- a/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java +++ b/sources/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java @@ -8,7 +8,7 @@ public class EaglercraftVersion { /// Customize these to fit your fork: public static final String projectForkName = "EaglercraftX"; - public static final String projectForkVersion = "u18"; + public static final String projectForkVersion = "u19"; public static final String projectForkVendor = "lax1dude"; public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; @@ -23,7 +23,7 @@ public class EaglercraftVersion { public static final String projectOriginName = "EaglercraftX"; public static final String projectOriginAuthor = "lax1dude"; public static final String projectOriginRevision = "1.8"; - public static final String projectOriginVersion = "u18"; + public static final String projectOriginVersion = "u19"; public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; diff --git a/sources/resources/assets/eagler/glsl/deferred/realistic_water_control.fsh b/sources/resources/assets/eagler/glsl/deferred/realistic_water_control.fsh index e914e71..43fe4bb 100644 --- a/sources/resources/assets/eagler/glsl/deferred/realistic_water_control.fsh +++ b/sources/resources/assets/eagler/glsl/deferred/realistic_water_control.fsh @@ -69,6 +69,11 @@ void main() { } float gbufferDepth = textureLod(u_gbufferDepthTexture, v_position2f2, 0.0).r; + + if(gbufferDepth < 0.000001) { + return; + } + vec4 gbufferDepthClipSpace4f = vec4(v_position2f2, gbufferDepth, 1.0); gbufferDepthClipSpace4f.xyz *= 2.0; gbufferDepthClipSpace4f.xyz -= 1.0;