Skip to content

Commit d58885a

Browse files
committed
fog clipping: properly invalidate projection matrix
1 parent 901c158 commit d58885a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/java/de/bixilon/minosoft/gui/rendering/camera/MatrixHandler.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ class MatrixHandler(
127127
this.matrixPosition = matrixPosition
128128
this.front = front
129129
val cameraBlockPosition = eyePosition.blockPosition
130-
if (fov != previousFOV) {
131-
calculateProjectionMatrix(fov)
132-
}
130+
calculateProjectionMatrix(fov)
133131
previousFOV = fov
134132

135133
updateFront(front)
@@ -179,4 +177,8 @@ class MatrixHandler(
179177
}
180178
}
181179
}
180+
181+
fun invalidate() {
182+
upToDate = false
183+
}
182184
}

src/main/java/de/bixilon/minosoft/gui/rendering/camera/fog/FogManager.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class FogManager(
7878
save()
7979
this.options = options
8080
state.revision++
81+
context.camera.matrixHandler.invalidate()
8182
}
8283

8384
private fun save() {
@@ -108,6 +109,7 @@ class FogManager(
108109
}
109110

110111
state.revision++
112+
context.camera.matrixHandler.invalidate()
111113
}
112114

113115

0 commit comments

Comments
 (0)