Skip to content

Commit aeb5957

Browse files
committed
rebuild chunks when fov is changed
1 parent 9b118e9 commit aeb5957

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/me/jellysquid/mods/sodium/client/render/SodiumWorldRenderer.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
4747
private int renderDistance;
4848

4949
private double lastCameraX, lastCameraY, lastCameraZ;
50-
private double lastCameraPitch, lastCameraYaw;
50+
private double lastCameraPitch, lastCameraYaw, lastFov;
5151

5252
private boolean useEntityCulling;
5353

@@ -145,9 +145,10 @@ public void updateChunks(Camera camera, Frustum frustum, boolean hasForcedFrustu
145145

146146
float pitch = camera.getPitch();
147147
float yaw = camera.getYaw();
148+
double fov = client.options.fov;
148149

149150
boolean dirty = cameraPos.x != this.lastCameraX || cameraPos.y != this.lastCameraY || cameraPos.z != this.lastCameraZ ||
150-
pitch != this.lastCameraPitch || yaw != this.lastCameraYaw;
151+
pitch != this.lastCameraPitch || yaw != this.lastCameraYaw || fov != this.lastFov;
151152

152153
if (dirty) {
153154
this.chunkRenderManager.markDirty();
@@ -158,6 +159,7 @@ public void updateChunks(Camera camera, Frustum frustum, boolean hasForcedFrustu
158159
this.lastCameraZ = cameraPos.z;
159160
this.lastCameraPitch = pitch;
160161
this.lastCameraYaw = yaw;
162+
this.lastFov = fov;
161163

162164
profiler.swap("chunk_update");
163165

@@ -322,7 +324,7 @@ public void onChunkRenderUpdated(ChunkRenderData meshBefore, ChunkRenderData mes
322324
* @return True if the entity is visible, otherwise false
323325
*/
324326
public boolean isEntityVisible(Entity entity) {
325-
if (!this.useEntityCulling) {
327+
if (!this.getUseEntityCulling()) {
326328
return true;
327329
}
328330

0 commit comments

Comments
 (0)