mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Merge pull request #15982 from sabrina-shanman/bug_lod_too-low
(BUGZ-1040) Fix LOD randomly being too low in simplified UI
This commit is contained in:
commit
75146a104d
3 changed files with 12 additions and 13 deletions
|
@ -54,6 +54,7 @@ void LODManager::setRenderTimes(float presentTime, float engineRunTime, float ba
|
|||
}
|
||||
|
||||
void LODManager::autoAdjustLOD(float realTimeDelta) {
|
||||
std::lock_guard<std::mutex> { _automaticLODLock };
|
||||
|
||||
// The "render time" is the worse of:
|
||||
// - engineRunTime: Time spent in the render thread in the engine producing the gpu::Frame N
|
||||
|
@ -235,6 +236,7 @@ void LODManager::resetLODAdjust() {
|
|||
}
|
||||
|
||||
void LODManager::setAutomaticLODAdjust(bool value) {
|
||||
std::lock_guard<std::mutex> { _automaticLODLock };
|
||||
_automaticLODAdjust = value;
|
||||
emit autoLODChanged();
|
||||
}
|
||||
|
@ -426,7 +428,6 @@ float LODManager::getWorldDetailQuality() const {
|
|||
return HIGH;
|
||||
}
|
||||
|
||||
|
||||
void LODManager::setLODQualityLevel(float quality) {
|
||||
_lodQualityLevel = quality;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#ifndef hifi_LODManager_h
|
||||
#define hifi_LODManager_h
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include <DependencyManager.h>
|
||||
#include <NumericalConstants.h>
|
||||
#include <OctreeConstants.h>
|
||||
|
@ -47,11 +49,6 @@ class AABox;
|
|||
* @property {number} presentTime <em>Read-only.</em>
|
||||
* @property {number} engineRunTime <em>Read-only.</em>
|
||||
* @property {number} gpuTime <em>Read-only.</em>
|
||||
* @property {number} avgRenderTime <em>Read-only.</em>
|
||||
* @property {number} fps <em>Read-only.</em>
|
||||
* @property {number} lodLevel <em>Read-only.</em>
|
||||
* @property {number} lodDecreaseFPS <em>Read-only.</em>
|
||||
* @property {number} lodIncreaseFPS <em>Read-only.</em>
|
||||
*/
|
||||
|
||||
class LODManager : public QObject, public Dependency {
|
||||
|
@ -240,6 +237,7 @@ signals:
|
|||
private:
|
||||
LODManager();
|
||||
|
||||
std::mutex _automaticLODLock;
|
||||
bool _automaticLODAdjust = true;
|
||||
|
||||
float _presentTime{ 0.0f }; // msec
|
||||
|
|
|
@ -531,21 +531,21 @@ function maybeUpdateOutputDeviceMutedOverlay() {
|
|||
|
||||
|
||||
var oldAutomaticLODAdjust;
|
||||
var oldLODLevel;
|
||||
var DEFAULT_AUTO_LOD_ADJUST = false;
|
||||
var DEFAULT_LOD_LEVEL = 0.5;
|
||||
var oldLODAngleDeg;
|
||||
var SIMPLIFIED_UI_AUTO_LOD_ADJUST = false;
|
||||
var SIMPLIFIED_UI_LOD_ANGLE_DEG = 0.5;
|
||||
function modifyLODSettings() {
|
||||
oldAutomaticLODAdjust = LODManager.automaticLODAdjust;
|
||||
oldLODLevel = LODManager.lodQualityLevel;
|
||||
oldLODAngleDeg = LODManager.lodAngleDeg;
|
||||
|
||||
LODManager.automaticLODAdjust = DEFAULT_AUTO_LOD_ADJUST;
|
||||
LODManager.lodQualityLevel = DEFAULT_LOD_LEVEL;
|
||||
LODManager.automaticLODAdjust = SIMPLIFIED_UI_AUTO_LOD_ADJUST;
|
||||
LODManager.lodAngleDeg = SIMPLIFIED_UI_LOD_ANGLE_DEG;
|
||||
}
|
||||
|
||||
|
||||
function restoreLODSettings() {
|
||||
LODManager.automaticLODAdjust = oldAutomaticLODAdjust;
|
||||
LODManager.lodQualityLevel = oldLODLevel;
|
||||
LODManager.lodAngleDeg = oldLODAngleDeg;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue