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;