From 44c03e46a9b292606ce74eff1baf9ff29f7d51ae Mon Sep 17 00:00:00 2001 From: Michael Lemaire Date: Wed, 12 Aug 2015 17:26:17 +0200 Subject: [PATCH] Tweaked opengl terrain tessellation to speed up rendering --- src/render/opengl/ExplorerChunkTerrain.cpp | 6 +++--- src/render/opengl/OpenGLTerrain.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/render/opengl/ExplorerChunkTerrain.cpp b/src/render/opengl/ExplorerChunkTerrain.cpp index 83fc58f..2d9f297 100644 --- a/src/render/opengl/ExplorerChunkTerrain.cpp +++ b/src/render/opengl/ExplorerChunkTerrain.cpp @@ -203,15 +203,15 @@ void ExplorerChunkTerrain::updatePriority(CameraDefinition* camera) { _texture_wanted_size = 2; } - else if (distance_to_camera < 50.0) + else if (distance_to_camera < 60.0) { _texture_wanted_size = _texture_max_size; } - else if (distance_to_camera < 100.0) + else if (distance_to_camera < 140.0) { _texture_wanted_size = _texture_max_size / 4; } - else if (distance_to_camera < 200.0) + else if (distance_to_camera < 300.0) { _texture_wanted_size = _texture_max_size / 8; } diff --git a/src/render/opengl/OpenGLTerrain.cpp b/src/render/opengl/OpenGLTerrain.cpp index 98426eb..a6c7ec9 100644 --- a/src/render/opengl/OpenGLTerrain.cpp +++ b/src/render/opengl/OpenGLTerrain.cpp @@ -58,7 +58,7 @@ void OpenGLTerrain::initialize() program->addFragmentSource("terrain"); // Add terrain chunks - int chunks = 20; + int chunks = 12; double size = 800.0; double chunksize = size / (double) chunks; double start = -size / 2.0;