From 4dccabeb83231557a353b22588043e32366ec062 Mon Sep 17 00:00:00 2001 From: bzzt lost a hitlab login Date: Wed, 6 May 2020 13:37:00 +0000 Subject: [PATCH] fix analyzation not taking instancecount in account + settings calibration Signed-off-by: Bret Curtis --- apps/openmw/mwrender/objectpaging.cpp | 7 +++++++ files/settings-default.cfg | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/objectpaging.cpp b/apps/openmw/mwrender/objectpaging.cpp index dc84ccdd2..d30bd7a63 100644 --- a/apps/openmw/mwrender/objectpaging.cpp +++ b/apps/openmw/mwrender/objectpaging.cpp @@ -264,6 +264,11 @@ namespace MWRender mCurrentStateSet = nullptr; return result; } + void addInstance(const Result& result) + { + for (auto pair : result.mStateSetCounter) + mGlobalStateSetCounter[pair.first] += pair.second; + } float getMergeBenefit(const Result& result) { if (result.mStateSetCounter.empty()) return 1; @@ -445,6 +450,8 @@ namespace MWRender emplaced.first->second.mAnalyzeResult = analyzeVisitor.retrieveResult(); emplaced.first->second.mNeedCompile = compile && cnode->referenceCount() <= 3; } + else + analyzeVisitor.addInstance(emplaced.first->second.mAnalyzeResult); emplaced.first->second.mInstances.push_back(&ref); } diff --git a/files/settings-default.cfg b/files/settings-default.cfg index f250b68aa..b8c151e56 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -110,16 +110,16 @@ max composite geometry size = 4.0 object paging = true # Affects the likelyhood of objects being merged. A higher value means merging is more likely and may improve FPS at the cost of memory. -object paging merge factor = 1500 +object paging merge factor = 250 # Cull objects smaller than this size divided by distance object paging min size = 0.01 # Adjusts 'min size' based on merging decision. Allows inexpensive objects to be rendered from a greater distance. -object paging min size merge factor = 0.6 +object paging min size merge factor = 0.3 # Controls how inexpensive an object needs to be to utilize 'min size merge factor'. -object paging min size cost multiplier = 4 +object paging min size cost multiplier = 25 # Assign a random color to merged batches. object paging debug batches = false