From f9212c9938488428714ce2ea042f4ac487aa32e2 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Wed, 18 Mar 2015 08:53:31 +0100 Subject: [PATCH] Increased renderdistance a bit to prevent popping of chunks. --- game/level.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/level.cc b/game/level.cc index 0ef2205..2b86dbd 100644 --- a/game/level.cc +++ b/game/level.cc @@ -55,10 +55,10 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass, glm::mat4* viewProjectionMatrix, std::vector* shadowVPs) { int renderDistance = 0; if ((int)farPlane % chunkSize == 0) { - renderDistance = (int)skydomeSize/chunkSize; + renderDistance = (((int)skydomeSize)+chunkSize/2)/chunkSize; } else { - renderDistance = ((int)skydomeSize/chunkSize) + 1; + renderDistance = ((((int)skydomeSize)+chunkSize/2)/chunkSize) + 1; } int xPosition = ((int)cameraCenter->getPosition().x + (terrain.getHeightmapWidth()/2))/chunkSize; int zPosition = ((int)cameraCenter->getPosition().z + (terrain.getHeightmapHeight()/2))/chunkSize;