fixed a bug where lightmap would flicker when cameraX rolls from small negative number to zero

This commit is contained in:
minjaesong
2021-09-11 22:46:50 +09:00
parent 784f5fd2ec
commit c9956f6c8b

View File

@@ -206,9 +206,9 @@ object IngameRenderer : Disposable {
if (!gamePaused || newWorldLoadedLatch) {
measureDebugTime("Renderer.ApparentLightRun") {
// recalculate for even frames, or if the sign of the cam-x changed
if (App.GLOBAL_RENDER_TIMER % 3 == 0 || WorldCamera.x * oldCamX < 0 || newWorldLoadedLatch)
if (App.GLOBAL_RENDER_TIMER % 3 == 0 || WorldCamera.x * oldCamX <= 0 || newWorldLoadedLatch) {
LightmapRenderer.fireRecalculateEvent(actorsRenderBehind, actorsRenderFront, actorsRenderMidTop, actorsRenderMiddle, actorsRenderOverlay)
}
oldCamX = WorldCamera.x
}