diff --git a/src/osgEarthDrivers/engine_rex/EngineContext b/src/osgEarthDrivers/engine_rex/EngineContext index 28656521ab..d1f77d27f3 100644 --- a/src/osgEarthDrivers/engine_rex/EngineContext +++ b/src/osgEarthDrivers/engine_rex/EngineContext @@ -76,9 +76,7 @@ namespace osgEarth { namespace REX const TerrainOptionsAPI& options() const { return _options; } - ProgressCallback* progress() const { return _progress.get(); } - - double getExpirationRange2() const { return _expirationRange2; } + ProgressCallback* progress() const { return _progress.get(); } ModifyBoundingBoxCallback* getModifyBBoxCallback() const { return _bboxCB.get(); } @@ -104,8 +102,7 @@ namespace osgEarth { namespace REX const SelectionInfo& _selectionInfo; osg::Timer_t _tick; int _tilesLastCull; - osg::ref_ptr _progress; - double _expirationRange2; + osg::ref_ptr _progress; osg::ref_ptr _bboxCB; const FrameClock* _clock; osg::ref_ptr _textures; diff --git a/src/osgEarthDrivers/engine_rex/EngineContext.cpp b/src/osgEarthDrivers/engine_rex/EngineContext.cpp index ff5e682c24..53bd8a8c5f 100644 --- a/src/osgEarthDrivers/engine_rex/EngineContext.cpp +++ b/src/osgEarthDrivers/engine_rex/EngineContext.cpp @@ -49,7 +49,6 @@ EngineContext::EngineContext( _tilesLastCull(0), _clock(clock) { - _expirationRange2 = _options.getMinExpiryRange() * _options.getMinExpiryRange(); _bboxCB = new ModifyBoundingBoxCallback(this); // create a bindless texture arena and set it to automatically diff --git a/src/osgEarthImGui/TerrainGUI b/src/osgEarthImGui/TerrainGUI index fab3ad6e6f..b9e1be4000 100644 --- a/src/osgEarthImGui/TerrainGUI +++ b/src/osgEarthImGui/TerrainGUI @@ -84,6 +84,8 @@ namespace osgEarth return; } + static unsigned u32_one = 1; + auto options = _mapNode->getTerrainOptions(); if (ImGuiLTable::Begin("terraingui")) @@ -111,8 +113,7 @@ namespace osgEarth visible_cb->setVisible(terrain_visible); } - static int max_max_lod = -1; - static unsigned u32_one = 1; + static int max_max_lod = -1; unsigned max_lod = options.getMaxLOD(); if (max_max_lod < 0) max_max_lod = max_lod; if (ImGuiLTable::InputScalar("Max LOD", ImGuiDataType_U32, &max_lod, &u32_one, nullptr, "%u")) @@ -152,6 +153,36 @@ namespace osgEarth engine->dirtyTerrainOptions(); } + // Expiration options + ImGui::Separator(); + unsigned int minExpiryFrames = options.getMinExpiryFrames(); + if (ImGuiLTable::InputScalar("Min Expiry Frames", ImGuiDataType_U32, &minExpiryFrames, &u32_one, nullptr, "%u")) + { + options.setMinExpiryFrames(minExpiryFrames); + engine->dirtyTerrainOptions(); + } + + float minExpiryTime = options.getMinExpiryTime(); + if (ImGuiLTable::InputFloat("Min Expiry Time", &minExpiryTime)) + { + options.setMinExpiryTime(minExpiryTime); + engine->dirtyTerrainOptions(); + } + + float minExpiryRange = options.getMinExpiryRange(); + if (ImGuiLTable::InputFloat("Min Expiry Range", &minExpiryRange)) + { + options.setMinExpiryRange(minExpiryRange); + engine->dirtyTerrainOptions(); + } + + unsigned int maxTilesToUnloadPerFrame = options.getMaxTilesToUnloadPerFrame(); + if (ImGuiLTable::InputScalar("Max Tiles to Unload", ImGuiDataType_U32, &maxTilesToUnloadPerFrame, &u32_one, nullptr, "%u")) + { + options.setMaxTilesToUnloadPerFrame(maxTilesToUnloadPerFrame); + engine->dirtyTerrainOptions(); + } + if (GLUtils::useNVGL()) { unsigned maxTex = options.getMaxTextureSize(); @@ -269,7 +300,7 @@ namespace osgEarth _sample = _sampler->getSample(mp); _ax = _x, _ay = _y; } - } + } ImGui::Separator();