mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:27:04 +02:00
Refined the capping of the LOD Target Rate to be the lower REfreshrate when FOcus-inactive, this prevent the panic attacks of the LOD system on low end hardware
This commit is contained in:
parent
07ddc535a0
commit
2d9a7f7c4f
9 changed files with 94 additions and 49 deletions
|
@ -269,6 +269,9 @@ Item {
|
||||||
StatText {
|
StatText {
|
||||||
text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
|
text: "GPU: " + root.gpuFrameTime.toFixed(1) + " ms"
|
||||||
}
|
}
|
||||||
|
StatText {
|
||||||
|
text: "LOD Target: " + root.lodTargetFramerate + " Hz Angle: " + root.lodAngle + " deg"
|
||||||
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: "Drawcalls: " + root.drawcalls
|
text: "Drawcalls: " + root.drawcalls
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,6 +259,35 @@ Item {
|
||||||
visible: root.expanded;
|
visible: root.expanded;
|
||||||
text: "Entity Servers In: " + root.entityPacketsInKbps + " kbps";
|
text: "Entity Servers In: " + root.entityPacketsInKbps + " kbps";
|
||||||
}
|
}
|
||||||
|
StatText {
|
||||||
|
visible: !root.expanded
|
||||||
|
text: "Octree Elements Server: " + root.serverElements +
|
||||||
|
" Local: " + root.localElements;
|
||||||
|
}
|
||||||
|
StatText {
|
||||||
|
visible: root.expanded
|
||||||
|
text: "Octree Sending Mode: " + root.sendingMode;
|
||||||
|
}
|
||||||
|
StatText {
|
||||||
|
visible: root.expanded
|
||||||
|
text: "Octree Packets to Process: " + root.packetStats;
|
||||||
|
}
|
||||||
|
StatText {
|
||||||
|
visible: root.expanded
|
||||||
|
text: "Octree Elements - ";
|
||||||
|
}
|
||||||
|
StatText {
|
||||||
|
visible: root.expanded
|
||||||
|
text: "\tServer: " + root.serverElements +
|
||||||
|
" Internal: " + root.serverInternal +
|
||||||
|
" Leaves: " + root.serverLeaves;
|
||||||
|
}
|
||||||
|
StatText {
|
||||||
|
visible: root.expanded
|
||||||
|
text: "\tLocal: " + root.localElements +
|
||||||
|
" Internal: " + root.localInternal +
|
||||||
|
" Leaves: " + root.localLeaves;
|
||||||
|
}
|
||||||
StatText {
|
StatText {
|
||||||
visible: root.expanded;
|
visible: root.expanded;
|
||||||
text: "Downloads: " + root.downloads + "/" + root.downloadLimit +
|
text: "Downloads: " + root.downloads + "/" + root.downloadLimit +
|
||||||
|
@ -316,6 +345,9 @@ Item {
|
||||||
StatText {
|
StatText {
|
||||||
text: "GPU frame size: " + root.gpuFrameSize.x + " x " + root.gpuFrameSize.y
|
text: "GPU frame size: " + root.gpuFrameSize.x + " x " + root.gpuFrameSize.y
|
||||||
}
|
}
|
||||||
|
StatText {
|
||||||
|
text: "LOD Target: " + root.lodTargetFramerate + " Hz Angle: " + root.lodAngle + " deg"
|
||||||
|
}
|
||||||
StatText {
|
StatText {
|
||||||
text: "Drawcalls: " + root.drawcalls
|
text: "Drawcalls: " + root.drawcalls
|
||||||
}
|
}
|
||||||
|
@ -401,35 +433,6 @@ Item {
|
||||||
text: " out of view: " + root.shadowOutOfView +
|
text: " out of view: " + root.shadowOutOfView +
|
||||||
" too small: " + root.shadowTooSmall;
|
" too small: " + root.shadowTooSmall;
|
||||||
}
|
}
|
||||||
StatText {
|
|
||||||
visible: !root.expanded
|
|
||||||
text: "Octree Elements Server: " + root.serverElements +
|
|
||||||
" Local: " + root.localElements;
|
|
||||||
}
|
|
||||||
StatText {
|
|
||||||
visible: root.expanded
|
|
||||||
text: "Octree Sending Mode: " + root.sendingMode;
|
|
||||||
}
|
|
||||||
StatText {
|
|
||||||
visible: root.expanded
|
|
||||||
text: "Octree Packets to Process: " + root.packetStats;
|
|
||||||
}
|
|
||||||
StatText {
|
|
||||||
visible: root.expanded
|
|
||||||
text: "Octree Elements - ";
|
|
||||||
}
|
|
||||||
StatText {
|
|
||||||
visible: root.expanded
|
|
||||||
text: "\tServer: " + root.serverElements +
|
|
||||||
" Internal: " + root.serverInternal +
|
|
||||||
" Leaves: " + root.serverLeaves;
|
|
||||||
}
|
|
||||||
StatText {
|
|
||||||
visible: root.expanded
|
|
||||||
text: "\tLocal: " + root.localElements +
|
|
||||||
" Internal: " + root.localInternal +
|
|
||||||
" Leaves: " + root.localLeaves;
|
|
||||||
}
|
|
||||||
StatText {
|
StatText {
|
||||||
visible: root.expanded
|
visible: root.expanded
|
||||||
text: "LOD: " + root.lodStatus;
|
text: "LOD: " + root.lodStatus;
|
||||||
|
|
|
@ -351,7 +351,18 @@ float LODManager::getHMDLODTargetFPS() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float LODManager::getLODTargetFPS() const {
|
float LODManager::getLODTargetFPS() const {
|
||||||
auto refreshRateFPS = qApp->getRefreshRateManager().getActiveRefreshRate();
|
|
||||||
|
// Use the current refresh rate as the recommended rate target used to cap the LOD manager control value.
|
||||||
|
// When focused, Use the Focus Inactive as the targget LOD to void abrupt changes from the lod controller.
|
||||||
|
auto& refreshRateManager = qApp->getRefreshRateManager();
|
||||||
|
auto refreshRateRegime = refreshRateManager.getRefreshRateRegime();
|
||||||
|
auto refreshRateProfile = refreshRateManager.getRefreshRateProfile();
|
||||||
|
auto refreshRateUXMode = refreshRateManager.getUXMode();
|
||||||
|
auto refreshRateFPS = refreshRateManager.getActiveRefreshRate();
|
||||||
|
if (refreshRateRegime == RefreshRateManager::RefreshRateRegime::FOCUS_ACTIVE) {
|
||||||
|
refreshRateFPS = refreshRateManager.queryRefreshRateTarget(refreshRateProfile, RefreshRateManager::RefreshRateRegime::FOCUS_INACTIVE, refreshRateUXMode);
|
||||||
|
}
|
||||||
|
|
||||||
auto lodTargetFPS = getDesktopLODTargetFPS();
|
auto lodTargetFPS = getDesktopLODTargetFPS();
|
||||||
if (qApp->isHMDMode()) {
|
if (qApp->isHMDMode()) {
|
||||||
lodTargetFPS = getHMDLODTargetFPS();
|
lodTargetFPS = getHMDLODTargetFPS();
|
||||||
|
|
|
@ -69,13 +69,14 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
|
||||||
RenderScriptingInterface::getInstance()->setShadowsEnabled(true);
|
RenderScriptingInterface::getInstance()->setShadowsEnabled(true);
|
||||||
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
|
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
|
||||||
|
|
||||||
// DependencyManager::get<LODManager>()->setWorldDetailQuality()
|
DependencyManager::get<LODManager>()->setWorldDetailQuality(0.5f);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PerformancePreset::MID:
|
case PerformancePreset::MID:
|
||||||
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::DEFERRED);
|
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::DEFERRED);
|
||||||
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
||||||
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE);
|
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE);
|
||||||
|
DependencyManager::get<LODManager>()->setWorldDetailQuality(0.5f);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PerformancePreset::LOW:
|
case PerformancePreset::LOW:
|
||||||
|
@ -83,6 +84,8 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
|
||||||
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
|
||||||
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO);
|
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO);
|
||||||
|
|
||||||
|
DependencyManager::get<LODManager>()->setWorldDetailQuality(0.75f);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PerformancePreset::UNKNOWN:
|
case PerformancePreset::UNKNOWN:
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -107,9 +107,7 @@ RefreshRateManager::RefreshRateProfile RefreshRateManager::getRefreshRateProfile
|
||||||
RefreshRateManager::RefreshRateProfile profile = RefreshRateManager::RefreshRateProfile::REALTIME;
|
RefreshRateManager::RefreshRateProfile profile = RefreshRateManager::RefreshRateProfile::REALTIME;
|
||||||
|
|
||||||
if (getUXMode() != RefreshRateManager::UXMode::VR) {
|
if (getUXMode() != RefreshRateManager::UXMode::VR) {
|
||||||
profile =(RefreshRateManager::RefreshRateProfile) _refreshRateProfileSettingLock.resultWithReadLock<int>([&] {
|
return _refreshRateProfile;
|
||||||
return _refreshRateProfileSetting.get();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
|
@ -138,15 +136,20 @@ void RefreshRateManager::setUXMode(RefreshRateManager::UXMode uxMode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int RefreshRateManager::queryRefreshRateTarget(RefreshRateProfile profile, RefreshRateRegime regime, UXMode uxMode) const {
|
||||||
|
int targetRefreshRate;
|
||||||
|
if (uxMode == RefreshRateManager::UXMode::DESKTOP) {
|
||||||
|
targetRefreshRate = REFRESH_RATE_PROFILES[profile][regime];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
targetRefreshRate = VR_TARGET_RATE;
|
||||||
|
}
|
||||||
|
return targetRefreshRate;
|
||||||
|
}
|
||||||
|
|
||||||
void RefreshRateManager::updateRefreshRateController() const {
|
void RefreshRateManager::updateRefreshRateController() const {
|
||||||
if (_refreshRateOperator) {
|
if (_refreshRateOperator) {
|
||||||
int targetRefreshRate;
|
int targetRefreshRate = queryRefreshRateTarget(_refreshRateProfile, _refreshRateRegime, _uxMode);
|
||||||
if (_uxMode == RefreshRateManager::UXMode::DESKTOP) {
|
|
||||||
targetRefreshRate = REFRESH_RATE_PROFILES[_refreshRateProfile][_refreshRateRegime];
|
|
||||||
} else {
|
|
||||||
targetRefreshRate = VR_TARGET_RATE;
|
|
||||||
}
|
|
||||||
|
|
||||||
_refreshRateOperator(targetRefreshRate);
|
_refreshRateOperator(targetRefreshRate);
|
||||||
_activeRefreshRate = targetRefreshRate;
|
_activeRefreshRate = targetRefreshRate;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,9 @@ public:
|
||||||
int getActiveRefreshRate() const { return _activeRefreshRate; }
|
int getActiveRefreshRate() const { return _activeRefreshRate; }
|
||||||
void updateRefreshRateController() const;
|
void updateRefreshRateController() const;
|
||||||
|
|
||||||
|
// query the refresh rate target at the specified combination
|
||||||
|
int queryRefreshRateTarget(RefreshRateProfile profile, RefreshRateRegime regime, UXMode uxMode) const;
|
||||||
|
|
||||||
void resetInactiveTimer();
|
void resetInactiveTimer();
|
||||||
void toggleInactive();
|
void toggleInactive();
|
||||||
|
|
||||||
|
|
|
@ -416,6 +416,8 @@ void Stats::updateStats(bool force) {
|
||||||
gpuContext->getFrameStats(gpuFrameStats);
|
gpuContext->getFrameStats(gpuFrameStats);
|
||||||
|
|
||||||
STAT_UPDATE(drawcalls, gpuFrameStats._DSNumDrawcalls);
|
STAT_UPDATE(drawcalls, gpuFrameStats._DSNumDrawcalls);
|
||||||
|
STAT_UPDATE(lodTargetFramerate, DependencyManager::get<LODManager>()->getLODTargetFPS());
|
||||||
|
STAT_UPDATE(lodAngle, DependencyManager::get<LODManager>()->getLODAngleDeg());
|
||||||
|
|
||||||
|
|
||||||
// Incoming packets
|
// Incoming packets
|
||||||
|
|
|
@ -109,6 +109,8 @@ private: \
|
||||||
* @property {number} shadowRendered - <em>Read-only.</em>
|
* @property {number} shadowRendered - <em>Read-only.</em>
|
||||||
* @property {string} sendingMode - <em>Read-only.</em>
|
* @property {string} sendingMode - <em>Read-only.</em>
|
||||||
* @property {string} packetStats - <em>Read-only.</em>
|
* @property {string} packetStats - <em>Read-only.</em>
|
||||||
|
* @property {number} lodAngle - <em>Read-only.</em>
|
||||||
|
* @property {number} lodTargetFramerate - <em>Read-only.</em>
|
||||||
* @property {string} lodStatus - <em>Read-only.</em>
|
* @property {string} lodStatus - <em>Read-only.</em>
|
||||||
* @property {string} timingStats - <em>Read-only.</em>
|
* @property {string} timingStats - <em>Read-only.</em>
|
||||||
* @property {string} gameUpdateStats - <em>Read-only.</em>
|
* @property {string} gameUpdateStats - <em>Read-only.</em>
|
||||||
|
@ -272,6 +274,8 @@ class Stats : public QQuickItem {
|
||||||
STATS_PROPERTY(int, shadowRendered, 0)
|
STATS_PROPERTY(int, shadowRendered, 0)
|
||||||
STATS_PROPERTY(QString, sendingMode, QString())
|
STATS_PROPERTY(QString, sendingMode, QString())
|
||||||
STATS_PROPERTY(QString, packetStats, QString())
|
STATS_PROPERTY(QString, packetStats, QString())
|
||||||
|
STATS_PROPERTY(int, lodAngle, 0)
|
||||||
|
STATS_PROPERTY(int, lodTargetFramerate, 0)
|
||||||
STATS_PROPERTY(QString, lodStatus, QString())
|
STATS_PROPERTY(QString, lodStatus, QString())
|
||||||
STATS_PROPERTY(QString, timingStats, QString())
|
STATS_PROPERTY(QString, timingStats, QString())
|
||||||
STATS_PROPERTY(QString, gameUpdateStats, QString())
|
STATS_PROPERTY(QString, gameUpdateStats, QString())
|
||||||
|
@ -858,6 +862,20 @@ signals:
|
||||||
*/
|
*/
|
||||||
void packetStatsChanged();
|
void packetStatsChanged();
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the value of the <code>lodAngle</code> property changes.
|
||||||
|
* @function Stats.lodAngleChanged
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void lodAngleChanged();
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the value of the <code>lodTargetFramerate</code> property changes.
|
||||||
|
* @function Stats.lodTargetFramerateChanged
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void lodTargetFramerateChanged();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggered when the value of the <code>lodStatus</code> property changes.
|
* Triggered when the value of the <code>lodStatus</code> property changes.
|
||||||
* @function Stats.lodStatusChanged
|
* @function Stats.lodStatusChanged
|
||||||
|
|
|
@ -102,8 +102,10 @@ void MACOSInstance::enumerateDisplays() {
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
auto displayID = CGMainDisplayID();
|
auto displayID = CGMainDisplayID();
|
||||||
auto displaySize = CGDisplayScreenSize(displayID);
|
auto displaySize = CGDisplayScreenSize(displayID);
|
||||||
auto displaySizeWidthInches = displaySize.width * 0.0393701;
|
|
||||||
auto displaySizeHeightInches = displaySize.height * 0.0393701;
|
const auto MM_TO_IN = 0.0393701;
|
||||||
|
auto displaySizeWidthInches = displaySize.width * MM_TO_IN;
|
||||||
|
auto displaySizeHeightInches = displaySize.height * MM_TO_IN;
|
||||||
auto displaySizeDiagonalInches = sqrt(displaySizeWidthInches * displaySizeWidthInches + displaySizeHeightInches * displaySizeHeightInches);
|
auto displaySizeDiagonalInches = sqrt(displaySizeWidthInches * displaySizeWidthInches + displaySizeHeightInches * displaySizeHeightInches);
|
||||||
|
|
||||||
auto displayPixelsWidth= CGDisplayPixelsWide(displayID);
|
auto displayPixelsWidth= CGDisplayPixelsWide(displayID);
|
||||||
|
@ -125,12 +127,10 @@ void MACOSInstance::enumerateDisplays() {
|
||||||
|
|
||||||
json display = {};
|
json display = {};
|
||||||
|
|
||||||
// display["physicalWidth"] = displaySizeWidthInches;
|
display["physicalWidth"] = displaySizeWidthInches;
|
||||||
// display["physicalHeight"] = displaySizeHeightInches;
|
display["physicalHeight"] = displaySizeHeightInches;
|
||||||
display["physicalDiagonal"] = displaySizeDiagonalInches;
|
display["physicalDiagonal"] = displaySizeDiagonalInches;
|
||||||
|
|
||||||
// display["ppiH"] = displayModeWidth / displaySizeWidthInches;
|
|
||||||
// display["ppiV"] = displayModeHeight / displaySizeHeightInches;
|
|
||||||
display["ppi"] = sqrt(displayModeHeight * displayModeHeight + displayModeWidth * displayModeWidth) / displaySizeDiagonalInches;
|
display["ppi"] = sqrt(displayModeHeight * displayModeHeight + displayModeWidth * displayModeWidth) / displaySizeDiagonalInches;
|
||||||
|
|
||||||
display["coordLeft"] = displayBounds.origin.x;
|
display["coordLeft"] = displayBounds.origin.x;
|
||||||
|
@ -148,8 +148,7 @@ void MACOSInstance::enumerateDisplays() {
|
||||||
display["refreshrate"] =displayRefreshrate;
|
display["refreshrate"] =displayRefreshrate;
|
||||||
display["modeWidth"] = displayModeWidth;
|
display["modeWidth"] = displayModeWidth;
|
||||||
display["modeHeight"] = displayModeHeight;
|
display["modeHeight"] = displayModeHeight;
|
||||||
|
|
||||||
|
|
||||||
_display.push_back(display);
|
_display.push_back(display);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue