Rebuild chunk graph if fog distance changes

This commit is contained in:
embeddedt authored and Jason Mitchell committed 2024-01-06 17:47:16 -08:00
1 parent 818f4d3cca
commit 17dddb6691
1 file changed
+6 -1
@@ -12,6 +12,7 @@ import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import jss.notfine.core.SettingsManager;
import lombok.Getter;
import me.jellysquid.mods.sodium.client.SodiumClientMod;
import me.jellysquid.mods.sodium.client.gl.compat.FogHelper;
import me.jellysquid.mods.sodium.client.gl.device.RenderDevice;
import me.jellysquid.mods.sodium.client.gui.SodiumGameOptions;
import me.jellysquid.mods.sodium.client.model.vertex.type.ChunkVertexType;
@@ -63,6 +64,7 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
private double lastCameraX, lastCameraY, lastCameraZ;
private double lastCameraPitch, lastCameraYaw;
private float lastFogDistance;
private boolean useEntityCulling;
@@ -208,8 +210,10 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
float pitch = camera.getPitch();
float yaw = camera.getYaw();
float fogDistance = FogHelper.getFogCutoff();
boolean dirty = pos.x != this.lastCameraX || pos.y != this.lastCameraY || pos.z != this.lastCameraZ ||
pitch != this.lastCameraPitch || yaw != this.lastCameraYaw;
pitch != this.lastCameraPitch || yaw != this.lastCameraYaw || fogDistance != this.lastFogDistance;
if(AngelicaConfig.enableIris) {
iris$ensureStateSwapped();
@@ -226,6 +230,7 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
this.lastCameraZ = pos.z;
this.lastCameraPitch = pitch;
this.lastCameraYaw = yaw;
this.lastFogDistance = fogDistance;
profiler.endStartSection("chunk_update");