Increased renderdistance a bit to prevent popping of chunks.

This commit is contained in:
Faerbit 2015-03-18 08:53:31 +01:00
parent 79223b4c02
commit f9212c9938

View File

@ -55,10 +55,10 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
glm::mat4* viewProjectionMatrix, std::vector<glm::mat4>* 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;