diff --git a/src/main/java/net/caffeinemc/mods/sodium/client/compatibility/checks/PreLaunchChecks.java b/src/main/java/net/caffeinemc/mods/sodium/client/compatibility/checks/PreLaunchChecks.java index 3ffc0026e4..eb2912bb04 100644 --- a/src/main/java/net/caffeinemc/mods/sodium/client/compatibility/checks/PreLaunchChecks.java +++ b/src/main/java/net/caffeinemc/mods/sodium/client/compatibility/checks/PreLaunchChecks.java @@ -69,7 +69,7 @@ public static void onGameInit() { Required version: 10.18.10.5161 (or newer) You must update your graphics card driver in order to continue.""" - .replace("###CURRENT_DRIVER###", NvidiaDriverVersion.parse(installedVersion).toString()), + .replace("###CURRENT_DRIVER###", installedVersion.toString()), "https://github.com/CaffeineMC/sodium-fabric/wiki/Driver-Compatibility#windows-intel-gen7"); } } @@ -87,7 +87,7 @@ public static void onGameInit() { Required version: 536.23 (or newer) You must update your graphics card driver in order to continue.""" - .replace("###CURRENT_DRIVER###", installedVersion.toString()), + .replace("###CURRENT_DRIVER###", NvidiaDriverVersion.parse(installedVersion).toString()), "https://github.com/CaffeineMC/sodium-fabric/wiki/Driver-Compatibility#nvidia-gpus"); } diff --git a/src/main/java/net/caffeinemc/mods/sodium/client/render/SodiumWorldRenderer.java b/src/main/java/net/caffeinemc/mods/sodium/client/render/SodiumWorldRenderer.java index 41f4204265..fe022ca6ed 100644 --- a/src/main/java/net/caffeinemc/mods/sodium/client/render/SodiumWorldRenderer.java +++ b/src/main/java/net/caffeinemc/mods/sodium/client/render/SodiumWorldRenderer.java @@ -39,6 +39,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; +import org.joml.Matrix4f; import org.joml.Vector3d; import java.util.Collection; @@ -57,6 +58,7 @@ public class SodiumWorldRenderer { private Vector3d lastCameraPos; private double lastCameraPitch, lastCameraYaw; private float lastFogDistance; + private Matrix4f lastProjectionMatrix; private boolean useEntityCulling; @@ -179,6 +181,7 @@ public void setupTerrain(Camera camera, Vec3 posRaw = camera.getPosition(); Vector3d pos = new Vector3d(posRaw.x(), posRaw.y(), posRaw.z()); + Matrix4f projectionMatrix = new Matrix4f(RenderSystem.getProjectionMatrix()); float pitch = camera.getXRot(); float yaw = camera.getYRot(); float fogDistance = RenderSystem.getShaderFogEnd(); @@ -186,13 +189,19 @@ public void setupTerrain(Camera camera, if (this.lastCameraPos == null) { this.lastCameraPos = new Vector3d(pos); } + if (this.lastProjectionMatrix == null) { + this.lastProjectionMatrix = new Matrix4f(projectionMatrix); + } boolean cameraLocationChanged = !pos.equals(this.lastCameraPos); boolean cameraAngleChanged = pitch != this.lastCameraPitch || yaw != this.lastCameraYaw || fogDistance != this.lastFogDistance; + boolean cameraProjectionChanged = !projectionMatrix.equals(this.lastProjectionMatrix); + + this.lastProjectionMatrix = projectionMatrix; this.lastCameraPitch = pitch; this.lastCameraYaw = yaw; - if (cameraLocationChanged || cameraAngleChanged) { + if (cameraLocationChanged || cameraAngleChanged || cameraProjectionChanged) { this.renderSectionManager.markGraphDirty(); }