From ced1ba32bbabbac5f4c022434b02cb4afeff7c62 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 4 Jul 2023 05:09:48 +1000 Subject: [PATCH] Fix terrain chunk meshes constantly being removed from the cache because the default time smear is the exact same as the timeout --- source/rendering/StarTilePainter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/rendering/StarTilePainter.cpp b/source/rendering/StarTilePainter.cpp index 10edb00..d0a7e5a 100644 --- a/source/rendering/StarTilePainter.cpp +++ b/source/rendering/StarTilePainter.cpp @@ -17,7 +17,11 @@ TilePainter::TilePainter(RendererPtr renderer) { auto assets = root.assets(); m_terrainChunkCache.setTimeToLive(assets->json("/rendering.config:chunkCacheTimeout").toInt()); + m_terrainChunkCache.setTimeSmear(m_terrainChunkCache.timeToLive() / 4); + m_liquidChunkCache.setTimeToLive(assets->json("/rendering.config:chunkCacheTimeout").toInt()); + m_liquidChunkCache.setTimeSmear(m_liquidChunkCache.timeToLive() / 4); + m_textureCache.setTimeToLive(assets->json("/rendering.config:textureTimeout").toInt()); m_backgroundLayerColor = jsonToColor(assets->json("/rendering.config:backgroundLayerColor")).toRgba();